Exemplo n.º 1
0
 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")
Exemplo n.º 2
0
 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")
Exemplo n.º 3
0
 def __len__(self):
     """``x.__len__() <==> len(x)``"""
     if self.transaction:
         return self.api.dbsize()
     LOG.warning("dbsize is not supported by codis")
Exemplo n.º 4
0
 def iterkeys(self, pattern="*"):
     '''使用迭代器遍历key
     '''
     if self.transaction:
         return iter(self.keys(pattern))
     LOG.warning("keys is not supported by codis")
Exemplo n.º 5
0
 def clear(self):
     """清理所有的key,该命令不支持codis
     """
     if self.transaction:
         return self.api.flushdb()
     LOG.warning("flushdb is not supported by codis")
Exemplo n.º 6
0
 def info(self):
     """获取info信息,该命令不支持codis
     """
     if self.transaction:
         return self.api.info()
     LOG.warning("info is not supported by codis")
Exemplo n.º 7
0
 def dbsize(self):
     """获取dbsize数量,改命令不支持codis
     """
     if self.transaction:
         return self.api.dbsize()
     LOG.warning("dbsize is not supported by codis")
Exemplo n.º 8
0
 def __len__(self):
     """``x.__len__() <==> len(x)``"""
     if self.transaction:
         return self.api.dbsize()
     LOG.warning("dbsize is not supported by codis")
Exemplo n.º 9
0
 def iterkeys(self, pattern="*"):
     '''使用迭代器遍历key
     '''
     if self.transaction:
         return iter(self.keys(pattern))
     LOG.warning("keys is not supported by codis")
Exemplo n.º 10
0
 def clear(self):
     """清理所有的key,该命令不支持codis
     """
     if self.transaction:
         return self.api.flushdb()
     LOG.warning("flushdb is not supported by codis")
Exemplo n.º 11
0
 def info(self):
     """获取info信息,该命令不支持codis
     """
     if self.transaction:
         return self.api.info()
     LOG.warning("info is not supported by codis")
Exemplo n.º 12
0
 def dbsize(self):
     """获取dbsize数量,改命令不支持codis
     """
     if self.transaction:
         return self.api.dbsize()
     LOG.warning("dbsize is not supported by codis")