working on alters

This commit is contained in:
Jon Haddad
2013-08-15 16:44:31 -07:00
parent f7b9953e0a
commit 6148b9edbf
2 changed files with 19 additions and 1 deletions

View File

@@ -75,7 +75,6 @@ def sync_table(model, create_missing_keyspace=True):
tables = [x[0] for x in tables.results]
#check for an existing column family
#TODO: check system tables instead of using cql thrifteries
if raw_cf_name not in tables:
qs = get_create_table(model)
@@ -218,6 +217,20 @@ def get_fields(model):
return [Field(x[0], x[1]) for x in tmp.results]
# convert to Field named tuples
def get_compaction_settings(model):
# returns a dictionary of compaction settings in an existing table
ks_name = model._get_keyspace()
col_family = model.column_family_name(include_keyspace=False)
with connection_manager() as con:
query = "SELECT , validator FROM system.schema_columns \
WHERE keyspace_name = :ks_name AND columnfamily_name = :col_family"
logger.debug("get_fields %s %s", ks_name, col_family)
tmp = con.execute(query, {'ks_name':ks_name, 'col_family':col_family})
import ipdb; ipdb.set_trace()
def delete_table(model):
warnings.warn("delete_table has been deprecated in favor of drop_table()", DeprecationWarning)
return drop_table(model)

View File

@@ -229,4 +229,9 @@ class LeveledCompactionTest(BaseCompactionTest):
drop_table(LeveledcompactionTestTable)
sync_table(LeveledcompactionTestTable)
LeveledcompactionTestTable.__compaction__ = SizeTieredCompactionStrategy
LeveledcompactionTestTable.__compaction_sstable_size_in_mb__ = None
sync_table(LeveledcompactionTestTable)