本文整理汇总了Python中mc_bin_client.MemcachedClient.getMeta方法的典型用法代码示例。如果您正苦于以下问题:Python MemcachedClient.getMeta方法的具体用法?Python MemcachedClient.getMeta怎么用?Python MemcachedClient.getMeta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mc_bin_client.MemcachedClient
的用法示例。
在下文中一共展示了MemcachedClient.getMeta方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify_revid
# 需要导入模块: from mc_bin_client import MemcachedClient [as 别名]
# 或者: from mc_bin_client.MemcachedClient import getMeta [as 别名]
def verify_revid(self):
missing_keys = False
src_node = self.get_active_vb0_node(self.src_master)
dest_node = self.get_active_vb0_node(self.dest_master)
src_client = MemcachedClient(src_node.ip, 11210)
dest_client = MemcachedClient(dest_node.ip, 11210)
src_client.sasl_auth_plain("cbadminbucket","password")
src_client.bucket_select("default")
dest_client.sasl_auth_plain("cbadminbucket","password")
dest_client.bucket_select("default")
for key in self.keys_loaded:
try:
src_meta = src_client.getMeta(key)
dest_meta = dest_client.getMeta(key)
self.log.info("deleted, flags, exp, rev_id, cas for key from Source({0}) {1} = {2}"
.format(src_node.ip, key, src_meta))
self.log.info("deleted, flags, exp, rev_id, cas for key from Destination({0}) {1} = {2}"
.format(dest_node.ip, key, dest_meta))
if src_meta == dest_meta:
self.log.info("RevID verification successful for key {0}".format(key))
else:
self.fail("RevID verification failed for key {0}".format(key))
except MemcachedError as e:
self.log.error("Key {0} threw {1} on getMeta()".format(key, e))
missing_keys = True
if missing_keys:
self.fail("Some keys are missing at destination")
示例2: verify_revid
# 需要导入模块: from mc_bin_client import MemcachedClient [as 别名]
# 或者: from mc_bin_client.MemcachedClient import getMeta [as 别名]
def verify_revid(self):
missing_keys = False
src_node = self.get_active_vb0_node(self.src_master)
dest_node = self.get_active_vb0_node(self.dest_master)
src_client = MemcachedClient(src_node.ip, 11210)
dest_client = MemcachedClient(dest_node.ip, 11210)
for key in self.keys_loaded:
try:
src_meta = src_client.getMeta(key)
dest_meta = dest_client.getMeta(key)
self.log.info("deleted, flags, exp, rev_id, cas for key from Source({0}) {1} = {2}"
.format(src_node.ip, key, src_meta))
self.log.info("deleted, flags, exp, rev_id, cas for key from Destination({0}) {1} = {2}"
.format(dest_node.ip, key, dest_meta))
if src_meta == dest_meta:
self.log.info("RevID verification successful for key {}".format(key))
else:
self.fail("RevID verification failed for key {}".format(key))
except MemcachedError:
self.log.error("Key {} is missing at destination".format(key))
missing_keys = True
if missing_keys:
self.fail("Some keys are missing at destination")
示例3: load_one_mutation_into_source_vb0
# 需要导入模块: from mc_bin_client import MemcachedClient [as 别名]
# 或者: from mc_bin_client.MemcachedClient import getMeta [as 别名]
def load_one_mutation_into_source_vb0(self, vb0_active_src_node):
key = self.vb0_keys[self.key_counter]
memc_client = MemcachedClient(vb0_active_src_node.ip, 11210)
try:
memc_client.set(key, exp=0, flags=0, val="dummy val")
self.key_counter += 1
self.keys_loaded.append(key)
self.log.info("Loaded key {} onto vb0 in {}".format(key, vb0_active_src_node.ip))
self.log.info ("deleted, flags, exp, rev_id, cas for key {} = {}".format(key, memc_client.getMeta(key)))
except MemcachedError as e:
self.log.error(e)
示例4: load_one_mutation_into_source_vb0
# 需要导入模块: from mc_bin_client import MemcachedClient [as 别名]
# 或者: from mc_bin_client.MemcachedClient import getMeta [as 别名]
def load_one_mutation_into_source_vb0(self, vb0_active_src_node):
key = self.vb0_keys[self.key_counter]
memc_client = MemcachedClient(vb0_active_src_node.ip, 11210)
memc_client.sasl_auth_plain("cbadminbucket","password")
memc_client.bucket_select("default")
try:
memc_client.set(key, exp=0, flags=0, val="dummy val")
self.key_counter += 1
self.keys_loaded.append(key)
self.log.info("Loaded key {0} onto vb0 in {1}".format(key, vb0_active_src_node.ip))
self.log.info ("deleted, flags, exp, rev_id, cas for key {0} = {1}".format(key, memc_client.getMeta(key)))
except MemcachedError as e:
self.log.error(e)