本文整理汇总了Python中membase.helper.cluster_helper.ClusterOperationHelper.set_expiry_pager_sleep_time方法的典型用法代码示例。如果您正苦于以下问题:Python ClusterOperationHelper.set_expiry_pager_sleep_time方法的具体用法?Python ClusterOperationHelper.set_expiry_pager_sleep_time怎么用?Python ClusterOperationHelper.set_expiry_pager_sleep_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类membase.helper.cluster_helper.ClusterOperationHelper
的用法示例。
在下文中一共展示了ClusterOperationHelper.set_expiry_pager_sleep_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: replication_verification
# 需要导入模块: from membase.helper.cluster_helper import ClusterOperationHelper [as 别名]
# 或者: from membase.helper.cluster_helper.ClusterOperationHelper import set_expiry_pager_sleep_time [as 别名]
def replication_verification(master, bucket_data, replica, test, failed_over=False):
asserts = []
rest = RestConnection(master)
buckets = rest.get_buckets()
nodes = rest.node_statuses()
test.log.info(
"expect {0} / {1} replication ? {2}".format(len(nodes), (1.0 + replica), len(nodes) / (1.0 + replica))
)
if len(nodes) / (1.0 + replica) >= 1:
test.assertTrue(
RebalanceHelper.wait_for_replication(rest.get_nodes(), timeout=300),
msg="replication did not complete after 5 minutes",
)
# run expiry_pager on all nodes before doing the replication verification
for bucket in buckets:
ClusterOperationHelper.set_expiry_pager_sleep_time(master, bucket.name)
test.log.info("wait for expiry pager to run on all these nodes")
time.sleep(30)
ClusterOperationHelper.set_expiry_pager_sleep_time(master, bucket.name, 3600)
ClusterOperationHelper.set_expiry_pager_sleep_time(master, bucket.name)
replica_match = RebalanceHelper.wait_till_total_numbers_match(
bucket=bucket.name, master=master, timeout_in_seconds=300
)
if not replica_match:
asserts.append("replication was completed but sum(curr_items) dont match the curr_items_total")
if not failed_over:
stats = rest.get_bucket_stats(bucket=bucket.name)
RebalanceHelper.print_taps_from_all_nodes(rest, bucket.name)
msg = "curr_items : {0} is not equal to actual # of keys inserted : {1}"
active_items_match = stats["curr_items"] == bucket_data[bucket.name]["items_inserted_count"]
if not active_items_match:
# asserts.append(
test.log.error(
msg.format(stats["curr_items"], bucket_data[bucket.name]["items_inserted_count"])
)
if len(asserts) > 0:
for msg in asserts:
test.log.error(msg)
test.assertTrue(len(asserts) == 0, msg=asserts)