本文整理汇总了Python中connection.Connection.system_update_column_family方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.system_update_column_family方法的具体用法?Python Connection.system_update_column_family怎么用?Python Connection.system_update_column_family使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connection.Connection
的用法示例。
在下文中一共展示了Connection.system_update_column_family方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SystemManager
# 需要导入模块: from connection import Connection [as 别名]
# 或者: from connection.Connection import system_update_column_family [as 别名]
#.........这里部分代码省略.........
cfdef.default_validation_class = 'org.apache.cassandra.db.marshal.%s' % default_validation_class
else:
cfdef.default_validation_class = default_validation_class
if comment is not None:
cfdef.comment = comment
self._cfdef_assign(key_cache_size, cfdef, 'key_cache_size')
self._cfdef_assign(row_cache_size, cfdef, 'row_cache_size')
self._cfdef_assign(gc_grace_seconds, cfdef, 'gc_grace_seconds')
self._cfdef_assign(read_repair_chance, cfdef, 'read_repair_chance')
self._cfdef_assign(min_compaction_threshold, cfdef, 'min_compaction_threshold')
self._cfdef_assign(max_compaction_threshold, cfdef, 'max_compaction_threshold')
self._cfdef_assign(key_cache_save_period_in_seconds, cfdef, 'key_cache_save_period_in_seconds')
self._cfdef_assign(row_cache_save_period_in_seconds, cfdef, 'row_cache_save_period_in_seconds')
self._cfdef_assign(memtable_flush_after_mins, cfdef, 'memtable_flush_after_mins')
self._cfdef_assign(memtable_throughput_in_mb, cfdef, 'memtable_throughput_in_mb')
self._cfdef_assign(memtable_operations_in_millions, cfdef, 'memtable_operations_in_millions')
self._system_add_column_family(cfdef)
def _cfdef_assign(self, attr, cfdef, attr_name):
if attr is not None:
if attr < 0:
self._raise_ire('%s must be non-negative' % attr_name)
else:
setattr(cfdef, attr_name, attr)
def _raise_ire(self, why):
ire = InvalidRequestException()
ire.why = why
raise ire
def _system_update_column_family(self, cfdef):
schema_version = self._conn.system_update_column_family(cfdef)
self._wait_for_agreement()
return schema_version
def alter_column_family(self, keyspace, column_family,
key_cache_size=None,
row_cache_size=None,
gc_grace_seconds=None,
read_repair_chance=None,
default_validation_class=None,
min_compaction_threshold=None,
max_compaction_threshold=None,
key_cache_save_period_in_seconds=None,
row_cache_save_period_in_seconds=None,
memtable_flush_after_mins=None,
memtable_throughput_in_mb=None,
memtable_operations_in_millions=None,
comment=None):
"""
Alters an existing column family.
Parameter meanings are the same as for :meth:`create_column_family`,
but column family attributes which may not be modified are not
included here.
"""
self._conn.set_keyspace(keyspace)
cfdef = self.get_keyspace_column_families(keyspace)[column_family]
self._cfdef_assign(key_cache_size, cfdef, 'key_cache_size')
示例2: SystemManager
# 需要导入模块: from connection import Connection [as 别名]
# 或者: from connection.Connection import system_update_column_family [as 别名]
#.........这里部分代码省略.........
if row_cache_save_period_in_seconds is not None:
if row_cache_save_period_in_seconds < 0:
ire = InvalidRequestException()
ire.why = 'row_cache_save_period_in_seconds must be non-negative'
raise ire
cfdef.row_cache_save_period_in_seconds = row_cache_save_period_in_seconds
if memtable_flush_after_mins is not None:
if memtable_flush_after_mins < 0:
ire = InvalidRequestException()
ire.why = 'memtable_flush_after_mins must be non-negative'
raise ire
cfdef.memtable_flush_after_mins = memtable_flush_after_mins
if memtable_throughput_in_mb is not None:
if memtable_throughput_in_mb < 0:
ire = InvalidRequestException()
ire.why = 'memtable_throughput_in_mb must be non-negative'
raise ire
cfdef.memtable_throughput_in_mb = memtable_throughput_in_mb
if memtable_throughput_in_millions is not None:
if memtable_throughput_in_millions < 0:
ire = InvalidRequestException()
ire.why = 'memtable_throughput_in_millions must be non-negative'
raise ire
cfdef.memtable_throughput_in_millions = memtable_throughput_in_millions
if comment is not None:
cfdef.comment = comment
self._system_add_column_family(cfdef)
def _system_update_column_family(self, cfdef):
schema_version = self._conn.system_update_column_family(cfdef)
self._wait_for_agreement()
return schema_version
def alter_column_family(self, keyspace, column_family,
key_cache_size=None,
row_cache_size=None,
gc_grace_seconds=None,
read_repair_chance=None,
default_validation_class=None,
min_compaction_threshold=None,
max_compaction_threshold=None,
key_cache_save_period_in_seconds=None,
row_cache_save_period_in_seconds=None,
memtable_flush_after_mins=None,
memtable_throughput_in_mb=None,
memtable_throughput_in_millions=None,
comment=None):
"""
Alters an existing column family.
Parameter meanings are the same as for :meth:`create_column_family`,
but column family attributes which may not be modified are not
included here.
"""
self._conn.set_keyspace(keyspace)
cfdef = self.get_keyspace_description(keyspace)[column_family]
if key_cache_size is not None: