当前位置: 首页>>代码示例>>Python>>正文


Python SystemManager.drop_column_family方法代码示例

本文整理汇总了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')
开发者ID:hansent,项目名称:shove,代码行数:9,代码来源:test_store.py

示例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))
开发者ID:occi,项目名称:TSP-CloudStack,代码行数:47,代码来源:connection.py

示例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
开发者ID:tonytan4ever,项目名称:Comedy,代码行数:38,代码来源:connection.py

示例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')
开发者ID:13111,项目名称:SickRage,代码行数:8,代码来源:test_cassandra_store.py

示例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')
开发者ID:YinYanfei,项目名称:pycassa,代码行数:5,代码来源:test_autopacking.py

示例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()
开发者ID:hiroakis,项目名称:simple-bbs-cassandra,代码行数:6,代码来源:app.py


注:本文中的pycassa.system_manager.SystemManager.drop_column_family方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。