当前位置: 首页>>代码示例>>Java>>正文


Java ResultMessage.SchemaChange方法代码示例

本文整理汇总了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();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:SchemaAlteringStatement.java

示例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);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:13,代码来源:SchemaAlteringStatement.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:29,代码来源:SchemaAlteringStatement.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:13,代码来源:CQLTester.java

示例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());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:7,代码来源:DropIndexStatement.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:7,代码来源:SchemaAlteringStatement.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:7,代码来源:DropIndexStatement.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:6,代码来源:SchemaAlteringStatement.java


注:本文中的org.apache.cassandra.transport.messages.ResultMessage.SchemaChange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。