本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.get_bucket方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.get_bucket方法的具体用法?Python RestConnection.get_bucket怎么用?Python RestConnection.get_bucket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.get_bucket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PerfBase
# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import get_bucket [as 别名]
#.........这里部分代码省略.........
self.set_up_rest(master)
self.reconfigure()
else:
self.reconfigure()
if self.parami("dgm", getattr(self, "dgm", 1)):
self.set_up_dgm()
time.sleep(10)
self.setUpBase1()
if self.input.clusters:
for cluster in self.input.clusters.values():
self.wait_until_warmed_up(cluster[0])
else:
self.wait_until_warmed_up()
ClusterOperationHelper.flush_os_caches(self.input.servers)
def set_up_rest(self, master):
self.rest = RestConnection(master)
self.rest_helper = RestHelper(self.rest)
def set_up_cluster(self, master):
"""Initialize cluster"""
self.log.info("setting up cluster")
self.rest.init_cluster(master.rest_username, master.rest_password)
memory_quota = self.parami('mem_quota', PerfDefaults.mem_quota)
self.rest.init_cluster_memoryQuota(master.rest_username,
master.rest_password,
memoryQuota=memory_quota)
def _get_bucket_names(self, num_buckets):
"""
Get a list of bucket names
"""
if num_buckets > 1:
buckets = ['bucket-{0}'.format(i) for i in range(num_buckets)]
else:
buckets = [self.param('bucket', 'default')]
return buckets
def get_bucket_conf(self):
""" retrieve bucket configurations"""
num_buckets = max(self.parami('num_buckets', 1),
self.parami('xdcr_num_buckets', 1))
self.buckets = self._get_bucket_names(num_buckets)
def set_up_buckets(self):
"""Set up data bucket(s)"""
self.log.info("setting up buckets")
self.get_bucket_conf()
for bucket in self.buckets:
bucket_ram_quota = self.parami('mem_quota', PerfDefaults.mem_quota)
bucket_ram_quota /= max(self.parami('num_buckets', 1),
self.parami('xdcr_num_buckets', 1))
replicas = self.parami('replicas', getattr(self, 'replicas', 1))
index_replicas = self.parami('index_replicas', 1)
self.rest.create_bucket(bucket=bucket, ramQuotaMB=bucket_ram_quota,