本文整理汇总了Java中org.apache.cassandra.service.MigrationManager.announceKeyspaceDrop方法的典型用法代码示例。如果您正苦于以下问题:Java MigrationManager.announceKeyspaceDrop方法的具体用法?Java MigrationManager.announceKeyspaceDrop怎么用?Java MigrationManager.announceKeyspaceDrop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.service.MigrationManager
的用法示例。
在下文中一共展示了MigrationManager.announceKeyspaceDrop方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: system_drop_keyspace
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
public String system_drop_keyspace(String keyspace)
throws InvalidRequestException, SchemaDisagreementException, TException
{
logger.debug("drop_keyspace");
try
{
ThriftValidation.validateKeyspaceNotSystem(keyspace);
state().hasKeyspaceAccess(keyspace, Permission.DROP);
MigrationManager.announceKeyspaceDrop(keyspace);
return Schema.instance.getVersion().toString();
}
catch (RequestValidationException e)
{
throw ThriftConversion.toThrift(e);
}
}
示例2: dropKSUnflushed
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
@Test
public void dropKSUnflushed() throws ConfigurationException
{
// sanity
final KeyspaceMetadata ks = Schema.instance.getKSMetaData(KEYSPACE3);
assertNotNull(ks);
final CFMetaData cfm = ks.tables.getNullable(TABLE1);
assertNotNull(cfm);
// write some data
for (int i = 0; i < 100; i++)
QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (key, name, val) VALUES (?, ?, ?)",
KEYSPACE3, TABLE1),
"dropKs", "col" + i, "anyvalue");
MigrationManager.announceKeyspaceDrop(ks.name);
assertNull(Schema.instance.getKSMetaData(ks.name));
}
示例3: dropKSUnflushed
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
@Test
public void dropKSUnflushed() throws ConfigurationException
{
DecoratedKey dk = Util.dk("dropKs");
// sanity
final KSMetaData ks = Schema.instance.getKSMetaData(KEYSPACE3);
Assert.assertNotNull(ks);
final CFMetaData cfm = ks.cfMetaData().get("Standard1");
Assert.assertNotNull(cfm);
// write some data
Mutation rm = new Mutation(ks.name, dk.getKey());
for (int i = 0; i < 100; i++)
rm.add(cfm.cfName, cellname("col" + i), ByteBufferUtil.bytes("anyvalue"), 1L);
rm.applyUnsafe();
MigrationManager.announceKeyspaceDrop(ks.name);
Assert.assertNull(Schema.instance.getKSMetaData(ks.name));
}
示例4: system_drop_keyspace
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
public String system_drop_keyspace(String keyspace)
throws InvalidRequestException, SchemaDisagreementException, TException
{
logger.debug("drop_keyspace");
try
{
keyspace = state().resolveKeyspace(keyspace);
ThriftValidation.validateKeyspaceNotSystem(keyspace);
state().hasKeyspaceAccess(keyspace, Permission.DROP);
MigrationManager.announceKeyspaceDrop(keyspace);
return Schema.instance.getVersion().toString();
}
catch (RequestValidationException e)
{
throw ThriftConversion.toThrift(e);
}
}
示例5: dropKSUnflushed
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
@Test
public void dropKSUnflushed() throws ConfigurationException
{
DecoratedKey dk = Util.dk("dropKs");
// sanity
final KSMetaData ks = Schema.instance.getKSMetaData("Keyspace3");
Assert.assertNotNull(ks);
final CFMetaData cfm = ks.cfMetaData().get("Standard1");
Assert.assertNotNull(cfm);
// write some data
Mutation rm = new Mutation(ks.name, dk.key);
for (int i = 0; i < 100; i++)
rm.add(cfm.cfName, cellname("col" + i), ByteBufferUtil.bytes("anyvalue"), 1L);
rm.apply();
MigrationManager.announceKeyspaceDrop(ks.name);
Assert.assertNull(Schema.instance.getKSMetaData(ks.name));
}
示例6: announceMigration
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
public boolean announceMigration(boolean isLocalOnly) throws ConfigurationException
{
try
{
MigrationManager.announceKeyspaceDrop(keyspace, isLocalOnly);
return true;
}
catch(ConfigurationException e)
{
if (ifExists)
return false;
throw e;
}
}
示例7: announceMigration
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
public void announceMigration() throws ConfigurationException
{
try
{
MigrationManager.announceKeyspaceDrop(keyspace);
}
catch(ConfigurationException e)
{
if (!ifExists)
throw e;
}
}
示例8: announceMigration
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
public Event.SchemaChange announceMigration(boolean isLocalOnly) throws ConfigurationException
{
try
{
MigrationManager.announceKeyspaceDrop(keyspace, isLocalOnly);
return new Event.SchemaChange(Event.SchemaChange.Change.DROPPED, keyspace());
}
catch(ConfigurationException e)
{
if (ifExists)
return null;
throw e;
}
}
示例9: announceMigration
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
public void announceMigration() throws ConfigurationException
{
MigrationManager.announceKeyspaceDrop(keyspace, clientState);
}
示例10: announceMigration
import org.apache.cassandra.service.MigrationManager; //导入方法依赖的package包/类
public void announceMigration() throws ConfigurationException
{
MigrationManager.announceKeyspaceDrop(keyspace);
}