def keys(self, pattern="*"): '''获取所有的key,不建议使用,codis本身也不支持 Args: pattern: 正则 Returns: list类型key的列表 ''' if self.transaction: return self.api.keys(pattern) LOG.warning("keys is not supported by codis")
def __len__(self): """``x.__len__() <==> len(x)``""" if self.transaction: return self.api.dbsize() LOG.warning("dbsize is not supported by codis")
def iterkeys(self, pattern="*"): '''使用迭代器遍历key ''' if self.transaction: return iter(self.keys(pattern)) LOG.warning("keys is not supported by codis")
def clear(self): """清理所有的key,该命令不支持codis """ if self.transaction: return self.api.flushdb() LOG.warning("flushdb is not supported by codis")
def info(self): """获取info信息,该命令不支持codis """ if self.transaction: return self.api.info() LOG.warning("info is not supported by codis")
def dbsize(self): """获取dbsize数量,改命令不支持codis """ if self.transaction: return self.api.dbsize() LOG.warning("dbsize is not supported by codis")