示例#1
0
def get_cassandra_store(host,
                        username,
                        password,
                        keyspace,
                        port=None,
                        prefix=""):
    store = CassandraProvisionerStore(host, port or 9160, username, password,
                                      keyspace, prefix)
    store.connect()
    return store
示例#2
0
文件: test_store.py 项目: timf/epu
    def setUp(self):
        prefix = str(uuid.uuid4())[:8]
        cf_defs = CassandraProvisionerStore.get_column_families(prefix=prefix)
        ks = cassandra.get_keyspace(cf_defs)

        self.cassandra_mgr = CassandraSchemaManager(ks)
        yield self.cassandra_mgr.create()

        host, port = cassandra.get_host_port()
        username, password = cassandra.get_credentials()

        self.store = CassandraProvisionerStore(host,
                                               port,
                                               username,
                                               password,
                                               keyspace=ks.name,
                                               prefix=prefix)
        self.store.connect()