本文整理汇总了Python中pycassa.system_manager.SystemManager.drop_column_family方法的典型用法代码示例。如果您正苦于以下问题:Python SystemManager.drop_column_family方法的具体用法?Python SystemManager.drop_column_family怎么用?Python SystemManager.drop_column_family使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycassa.system_manager.SystemManager
的用法示例。
在下文中一共展示了SystemManager.drop_column_family方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
# 需要导入模块: from pycassa.system_manager import SystemManager [as 别名]
# 或者: from pycassa.system_manager.SystemManager import drop_column_family [as 别名]
def tearDown(self):
if self.store._store is not None:
self.store.clear()
self.store.close()
from pycassa.system_manager import SystemManager # @UnresolvedImport @IgnorePep8
system_manager = SystemManager('localhost:9160')
system_manager.drop_column_family('Murk', 'shove')
示例2: __init__
# 需要导入模块: from pycassa.system_manager import SystemManager [as 别名]
# 或者: from pycassa.system_manager.SystemManager import drop_column_family [as 别名]
class CassandraDbSysManager:
def __init__(self):
try:
logger.info("Connection to " + DB_IP + ":" + DB_PORT + " ...")
self.sysDB = SystemManager(DB_IP + ":" + DB_PORT)
logger.info("Connection to the systemManager established.")
except Exception as exep:
logger.warning("Could not connect to the DB '" + DB_IP + ":" + DB_PORT + "'. | " + str(exep))
def create_keyspace(self, KeyspaceName, replica_factor):
try:
logger.info(
"Creating the Keyspace '" + KeyspaceName + "' with replica_factor '" + str(replica_factor) + "'")
self.sysDB.create_keyspace(KeyspaceName, replica_factor)
logger.info("Keyspace created.")
except Exception as exep:
logger.warning("Could not create the keyspace '" + KeyspaceName + "'. | " + str(exep))
def drop_keyspace(self, KeyspaceName):
try:
logger.info("Dropping the Keyspace '" + KeyspaceName + "'")
self.sysDB.drop_keyspace(KeyspaceName)
logger.info("Keyspace dropped.")
except Exception as exep:
logger.warning("Could not drop the keyspace '" + KeyspaceName + "'. | " + str(exep))
def create_column_family(self, KeyspaceName, columnFamily):
try:
logger.info("Creating the Column family '" + columnFamily + "' into the keyspace '" + KeyspaceName + "'")
self.sysDB.create_column_family(KeyspaceName, columnFamily, super=False,
comparator_type=pycassa.system_manager.ASCII_TYPE)
logger.info("Column Family created.")
except Exception as exep:
logger.warning(
"Could not create the Column Family '" + columnFamily + "' into the keyspace '" + KeyspaceName + "'. | " + str(
exep))
def drop_column_family(self, KeyspaceName, columnFamily):
try:
logger.info("Dropping the Column Family '" + columnFamily + "' from the Keyspace '" + KeyspaceName + "'")
self.sysDB.drop_column_family(KeyspaceName, columnFamily)
logger.info("Column Family dropped.")
except Exception as exep:
logger.warning("Could not drop the column family '" + columnFamily + "'. | " + str(exep))
示例3: ComedySysManagerConnection
# 需要导入模块: from pycassa.system_manager import SystemManager [as 别名]
# 或者: from pycassa.system_manager.SystemManager import drop_column_family [as 别名]
class ComedySysManagerConnection(object):
"""
This is a also a client connection of Cassandra, difference is it is only for System-Manager level
"""
def __init__(self, server='localhost:9160', credentials=None, framed_transport=True,
timeout=_DEFAULT_TIMEOUT):
self.conn = SystemManager(server,credentials,framed_transport,timeout)
def create_keyspace(self, name, replication_strategy='SimpleStrategy', strategy_options=None, durable_writes=True, **ks_kwargs):
"""Create a database"""
self.conn.create_keyspace(name, replication_strategy, strategy_options, durable_writes)
create_database = create_keyspace
def drop_keyspace(self, keyspace):
"""Drop a database"""
self.conn.drop_keyspace(keyspace)
drop_database = drop_keyspace
def create_column_family(self, keyspace, name, column_validation_classes=None, **cf_kwargs):
"""Create a table"""
self.conn.create_column_family(keyspace, name, column_validation_classes=None, **cf_kwargs)
create_table = create_column_family
def drop_column_family(self, keyspace, column_family):
"""Drop a table"""
self.conn.drop_column_family(keyspace, column_family)
drop_table = drop_column_family
def close(self):
pass
示例4: tearDown
# 需要导入模块: from pycassa.system_manager import SystemManager [as 别名]
# 或者: from pycassa.system_manager.SystemManager import drop_column_family [as 别名]
def tearDown(self):
self.store.clear()
self.store.close()
from pycassa.system_manager import SystemManager
system_manager = SystemManager('localhost:9160')
system_manager.drop_column_family('Foo', 'shove')
示例5: teardown_class
# 需要导入模块: from pycassa.system_manager import SystemManager [as 别名]
# 或者: from pycassa.system_manager.SystemManager import drop_column_family [as 别名]
def teardown_class(cls):
sys = SystemManager()
sys.drop_column_family(TEST_KS, 'StdInteger')
示例6: _drop_cf
# 需要导入模块: from pycassa.system_manager import SystemManager [as 别名]
# 或者: from pycassa.system_manager.SystemManager import drop_column_family [as 别名]
def _drop_cf(self, cf_name):
sys_mng = SystemManager('localhost:9160')
sys_mng.drop_column_family('bbs',cf_name)
sys_mng.close()