本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.set_xdcr_param方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.set_xdcr_param方法的具体用法?Python RestConnection.set_xdcr_param怎么用?Python RestConnection.set_xdcr_param使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.set_xdcr_param方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: customize_xdcr_settings
# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import set_xdcr_param [as 别名]
def customize_xdcr_settings(self):
"""Set custom XDCR environment variables"""
max_concurrent_reps_per_doc = self.param('max_concurrent_reps_per_doc', None)
xdcr_doc_batch_size_kb = self.param('xdcr_doc_batch_size_kb', None)
xdcr_checkpoint_interval = self.param('xdcr_checkpoint_interval', None)
xdcr_latency_optimization = self.param('xdcr_latency_optimization', None)
if max_concurrent_reps_per_doc:
param = 'xdcrMaxConcurrentReps'
value = max_concurrent_reps_per_doc
elif xdcr_doc_batch_size_kb:
param = 'xdcrDocBatchSizeKb'
value = xdcr_doc_batch_size_kb
elif xdcr_checkpoint_interval:
param = 'xdcrCheckpointInterval'
value = xdcr_checkpoint_interval
else:
return
self.log.info("changing {0} to {1}".format(param, value))
for servers in self.input.clusters.values():
rest_conn = RestConnection(servers[0])
replications = rest_conn.get_replications()
for repl in replications:
src_bucket = repl.get_src_bucket()
dst_bucket = repl.get_dest_bucket()
rest_conn.set_xdcr_param(src_bucket.name, dst_bucket.name, param, value)