本文整理汇总了Python中ccmlib.cluster.Cluster.set_environment_variable方法的典型用法代码示例。如果您正苦于以下问题:Python Cluster.set_environment_variable方法的具体用法?Python Cluster.set_environment_variable怎么用?Python Cluster.set_environment_variable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ccmlib.cluster.Cluster
的用法示例。
在下文中一共展示了Cluster.set_environment_variable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_ccm_cluster
# 需要导入模块: from ccmlib.cluster import Cluster [as 别名]
# 或者: from ccmlib.cluster.Cluster import set_environment_variable [as 别名]
def create_ccm_cluster(dtest_setup):
logger.info("cluster ccm directory: " + dtest_setup.test_path)
version = dtest_setup.dtest_config.cassandra_version
if version:
cluster = Cluster(dtest_setup.test_path, dtest_setup.cluster_name, cassandra_version=version)
else:
cluster = Cluster(dtest_setup.test_path, dtest_setup.cluster_name, cassandra_dir=dtest_setup.dtest_config.cassandra_dir)
cluster.set_datadir_count(dtest_setup.dtest_config.data_dir_count)
cluster.set_environment_variable('CASSANDRA_LIBJEMALLOC', dtest_setup.dtest_config.jemalloc_path)
return cluster
示例2: create_ccm_cluster
# 需要导入模块: from ccmlib.cluster import Cluster [as 别名]
# 或者: from ccmlib.cluster.Cluster import set_environment_variable [as 别名]
def create_ccm_cluster(self, name):
logger.debug("cluster ccm directory: " + self.test_path)
version = self.dtest_config.cassandra_version
if version:
cluster = Cluster(self.test_path, name, cassandra_version=version)
else:
cluster = Cluster(self.test_path, name, cassandra_dir=self.dtest_config.cassandra_dir)
if self.dtest_config.use_vnodes:
cluster.set_configuration_options(values={'initial_token': None, 'num_tokens': self.dtest_config.num_tokens})
else:
cluster.set_configuration_options(values={'num_tokens': None})
if self.dtest_config.use_off_heap_memtables:
cluster.set_configuration_options(values={'memtable_allocation_type': 'offheap_objects'})
cluster.set_datadir_count(self.dtest_config.data_dir_count)
cluster.set_environment_variable('CASSANDRA_LIBJEMALLOC', self.dtest_config.jemalloc_path)
return cluster
示例3: create_ccm_cluster
# 需要导入模块: from ccmlib.cluster import Cluster [as 别名]
# 或者: from ccmlib.cluster.Cluster import set_environment_variable [as 别名]
def create_ccm_cluster(test_path, name):
debug("cluster ccm directory: " + test_path)
version = os.environ.get('CASSANDRA_VERSION')
cdir = CASSANDRA_DIR
if version:
cluster = Cluster(test_path, name, cassandra_version=version)
else:
cluster = Cluster(test_path, name, cassandra_dir=cdir)
if DISABLE_VNODES:
cluster.set_configuration_options(values={'num_tokens': None})
else:
cluster.set_configuration_options(values={'initial_token': None, 'num_tokens': NUM_TOKENS})
if OFFHEAP_MEMTABLES:
cluster.set_configuration_options(values={'memtable_allocation_type': 'offheap_objects'})
cluster.set_datadir_count(DATADIR_COUNT)
cluster.set_environment_variable('CASSANDRA_LIBJEMALLOC', CASSANDRA_LIBJEMALLOC)
return cluster