本文整理汇总了Java中org.apache.cassandra.transport.messages.ResultMessage.SchemaChange方法的典型用法代码示例。如果您正苦于以下问题:Java ResultMessage.SchemaChange方法的具体用法?Java ResultMessage.SchemaChange怎么用?Java ResultMessage.SchemaChange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.transport.messages.ResultMessage
的用法示例。
在下文中一共展示了ResultMessage.SchemaChange方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public ResultMessage execute(QueryState state, QueryOptions options) throws RequestValidationException
{
// If an IF [NOT] EXISTS clause was used, this may not result in an actual schema change. To avoid doing
// extra work in the drivers to handle schema changes, we return an empty message in this case. (CASSANDRA-7600)
boolean didChangeSchema = announceMigration(false);
return didChangeSchema ? new ResultMessage.SchemaChange(changeEvent()) : new ResultMessage.Void();
}
示例2: executeInternal
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public ResultMessage executeInternal(QueryState state, QueryOptions options)
{
try
{
boolean didChangeSchema = announceMigration(true);
return didChangeSchema ? new ResultMessage.SchemaChange(changeEvent()) : new ResultMessage.Void();
}
catch (RequestValidationException e)
{
throw new RuntimeException(e);
}
}
示例3: execute
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public ResultMessage execute(QueryState state, QueryOptions options) throws RequestValidationException
{
// If an IF [NOT] EXISTS clause was used, this may not result in an actual schema change. To avoid doing
// extra work in the drivers to handle schema changes, we return an empty message in this case. (CASSANDRA-7600)
Event.SchemaChange ce = announceMigration(false);
if (ce == null)
return new ResultMessage.Void();
// when a schema alteration results in a new db object being created, we grant permissions on the new
// object to the user performing the request if:
// * the user is not anonymous
// * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and
// custom external implementations may not)
AuthenticatedUser user = state.getClientState().getUser();
if (user != null && !user.isAnonymous() && ce.change == Event.SchemaChange.Change.CREATED)
{
try
{
grantPermissionsToCreator(state);
}
catch (UnsupportedOperationException e)
{
// not a problem, grant is an optional method on IAuthorizer
}
}
return new ResultMessage.SchemaChange(ce);
}
示例4: assertLastSchemaChange
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
protected void assertLastSchemaChange(Event.SchemaChange.Change change, Event.SchemaChange.Target target,
String keyspace, String name,
String... argTypes)
{
Assert.assertTrue(lastSchemaChangeResult instanceof ResultMessage.SchemaChange);
ResultMessage.SchemaChange schemaChange = (ResultMessage.SchemaChange) lastSchemaChangeResult;
Assert.assertSame(change, schemaChange.change.change);
Assert.assertSame(target, schemaChange.change.target);
Assert.assertEquals(keyspace, schemaChange.change.keyspace);
Assert.assertEquals(name, schemaChange.change.name);
Assert.assertEquals(argTypes != null ? Arrays.asList(argTypes) : null, schemaChange.change.argTypes);
}
示例5: execute
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
@Override
public ResultMessage execute(QueryState state, QueryOptions options) throws RequestValidationException
{
announceMigration(false);
return indexedCF == null ? null : new ResultMessage.SchemaChange(changeEvent());
}
示例6: execute
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public ResultMessage execute(QueryState state, QueryOptions options) throws RequestValidationException
{
announceMigration();
String tableName = cfName == null || columnFamily() == null ? "" : columnFamily();
return new ResultMessage.SchemaChange(changeType(), keyspace(), tableName);
}
示例7: execute
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
@Override
public ResultMessage execute(QueryState state, QueryOptions options) throws RequestValidationException
{
Event.SchemaChange ce = announceMigration(false);
return ce == null ? null : new ResultMessage.SchemaChange(ce);
}
示例8: executeInternal
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public ResultMessage executeInternal(QueryState state, QueryOptions options)
{
Event.SchemaChange ce = announceMigration(true);
return ce == null ? new ResultMessage.Void() : new ResultMessage.SchemaChange(ce);
}