本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.get_recent_xdcr_vb_ckpt方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.get_recent_xdcr_vb_ckpt方法的具体用法?Python RestConnection.get_recent_xdcr_vb_ckpt怎么用?Python RestConnection.get_recent_xdcr_vb_ckpt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.get_recent_xdcr_vb_ckpt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_and_validate_latest_checkpoint
# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import get_recent_xdcr_vb_ckpt [as 别名]
def get_and_validate_latest_checkpoint(self):
rest_con = RestConnection(self.src_master)
try:
checkpoint_record = rest_con.get_recent_xdcr_vb_ckpt('default')
self.log.info("Checkpoint record : {}".format(checkpoint_record))
self.chkpt_records.append(checkpoint_record)
except Exception as e:
raise XDCRCheckpointException("Error retrieving last checkpoint document - {}".format(e))
failover_uuid = checkpoint_record["failover_uuid"]
seqno = checkpoint_record["seqno"]
self.log.info ("Verifying commitopaque/remote failover log ...")
if seqno != 0:
self.validate_remote_failover_log(checkpoint_record["target_vb_opaque"]["target_vb_uuid"], checkpoint_record["target_seqno"])
self.log.info ("Verifying local failover uuid ...")
local_vb_uuid, _ = self.get_failover_log(self.src_master)
self.assertTrue((int(failover_uuid) == int(local_vb_uuid)) or
(int(failover_uuid) == 0),
"local failover_uuid is wrong in checkpoint record! Expected: {0} seen: {1}".
format(local_vb_uuid,failover_uuid))
self.log.info("Checkpoint record verified")
else:
self.log.info("Skipping checkpoint record checks for checkpoint-0")
return True
示例2: get_and_validate_latest_checkpoint
# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import get_recent_xdcr_vb_ckpt [as 别名]
def get_and_validate_latest_checkpoint(self):
rest_con = RestConnection(self.src_master)
try:
checkpoint_record = rest_con.get_recent_xdcr_vb_ckpt('default', 'default', '0')
self.log.info("Checkpoint record : {}".format(checkpoint_record))
self.chkpt_records.append(checkpoint_record)
except Exception as e:
raise XDCRCheckpointException("Error retrieving last checkpoint document - {}".format(e))
commit_opaque = checkpoint_record["commitopaque"]
failover_uuid = checkpoint_record["failover_uuid"]
upr_snap_seqno = checkpoint_record["upr_snapshot_seqno"]
seqno = checkpoint_record["seqno"]
start_time = checkpoint_record["start_time"]
total_docs_checked = checkpoint_record["total_docs_checked"]
total_docs_written = checkpoint_record["total_docs_written"]
total_data_repl = checkpoint_record["total_data_replicated"]
end_time = checkpoint_record["end_time"]
self.log.info ("Verifying commitopaque/remote failover log ...")
if seqno != 0:
self.validate_remote_failover_log(commit_opaque[0], commit_opaque[1])
self.log.info ("Verifying last checkpointed seqno ...")
self.validate_last_checkpointed_seqno(int(seqno))
self.log.info ("Verifying local failover uuid ...")
local_vb_uuid, _ = self.get_failover_log(self.src_master)
self.assertTrue(int(local_vb_uuid) == int(failover_uuid),
"local failover_uuid is wrong in checkpoint record! Expected: {0} seen: {1}".
format(local_vb_uuid,failover_uuid))
self.log.info("Checkpoint record verified")
else:
self.log.info("Skipping checkpoint record checks for checkpoint-0")
return True