service/migration_manager: Implement announce_column_family_drop()

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This commit is contained in:
Pekka Enberg
2015-09-28 13:58:07 +03:00
committed by Pekka Enberg
parent 633279415d
commit 042e9252d5

View File

@@ -399,14 +399,11 @@ future<> migration_manager::announce_column_family_drop(const sstring& ks_name,
{
try {
auto& db = get_local_storage_proxy().get_db().local();
/*auto&& cfm = */db.find_schema(ks_name, cf_name);
/*auto&& ksm = */db.find_keyspace(ks_name);
#if 0
logger.info(String.format("Drop table '%s/%s'", oldCfm.ksName, oldCfm.cfName));
announce(LegacySchemaTables.makeDropTableMutation(ksm, oldCfm, FBUtilities.timestampMicros()), announceLocally);
#endif
// FIXME
throw std::runtime_error("not implemented");
auto&& old_cfm = db.find_schema(ks_name, cf_name);
auto&& keyspace = db.find_keyspace(ks_name);
logger.info("Drop table '{}/{}'", old_cfm->ks_name(), old_cfm->cf_name());
auto mutations = db::schema_tables::make_drop_table_mutations(keyspace.metadata(), old_cfm, db_clock::now_in_usecs());
return announce(std::move(mutations), announce_locally);
} catch (const no_such_column_family& e) {
throw exceptions::configuration_exception(sprint("Cannot drop non existing table '%s' in keyspace '%s'.", cf_name, ks_name));
}