当前位置: 首页>>代码示例>>Python>>正文


Python RestConnection.get_replication_for_buckets方法代码示例

本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.get_replication_for_buckets方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.get_replication_for_buckets方法的具体用法?Python RestConnection.get_replication_for_buckets怎么用?Python RestConnection.get_replication_for_buckets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lib.membase.api.rest_client.RestConnection的用法示例。


在下文中一共展示了RestConnection.get_replication_for_buckets方法的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_replication_for_buckets [as 别名]
    def get_and_validate_latest_checkpoint(self):
        rest_con = RestConnection(self.get_active_vb0_node(self.src_master))
        repl = rest_con.get_replication_for_buckets('default', 'default')
        try:
            checkpoint_record = rest_con.get_recent_xdcr_vb_ckpt(repl['id'])
            self.log.info("Checkpoint record : {0}".format(checkpoint_record))
            self.chkpt_records.append(checkpoint_record)
        except Exception as e:
            raise XDCRCheckpointException("Error retrieving last checkpoint document - {0}".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
开发者ID:EricACooper,项目名称:testrunner,代码行数:28,代码来源:checkpointXDCR.py

示例2: get_stat_successful_checkpoints

# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import get_replication_for_buckets [as 别名]
 def get_stat_successful_checkpoints(self):
     """
     Get num_checkpoints xdcr stat for default replication
     """
     rest = RestConnection(self.src_master)
     repl = rest.get_replication_for_buckets('default', 'default')
     val = rest.fetch_bucket_xdcr_stats()['op']['samples']['replications/'+repl['id']+'/num_checkpoints']
     return int(val[-1])
开发者ID:pkdevboxy,项目名称:testrunner,代码行数:10,代码来源:checkpointXDCR.py


注:本文中的lib.membase.api.rest_client.RestConnection.get_replication_for_buckets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。