本文整理汇总了Java中org.apache.cassandra.transport.messages.ResultMessage.Void方法的典型用法代码示例。如果您正苦于以下问题:Java ResultMessage.Void方法的具体用法?Java ResultMessage.Void怎么用?Java ResultMessage.Void使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.transport.messages.ResultMessage
的用法示例。
在下文中一共展示了ResultMessage.Void方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processStatement
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public ResultMessage processStatement(CQLStatement statement, QueryState queryState, QueryOptions options)
throws RequestExecutionException, RequestValidationException
{
logger.trace("Process {} @CL.{}", statement, options.getConsistency());
ClientState clientState = queryState.getClientState();
statement.checkAccess(clientState);
statement.validate(clientState);
ResultMessage result = statement.execute(queryState, options);
return result == null ? new ResultMessage.Void() : result;
}
示例2: execute
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
private ResultMessage execute(QueryState queryState, BatchQueryOptions options, boolean local, long now)
throws RequestExecutionException, RequestValidationException
{
if (options.getConsistency() == null)
throw new InvalidRequestException("Invalid empty consistency level");
if (options.getSerialConsistency() == null)
throw new InvalidRequestException("Invalid empty serial consistency level");
if (hasConditions)
return executeWithConditions(options, queryState);
executeWithoutConditions(getMutations(options, local, now), options.getConsistency());
return new ResultMessage.Void();
}
示例3: resultMessage
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
private ResultMessage resultMessage(List<PermissionDetails> details)
{
if (details.isEmpty())
return new ResultMessage.Void();
ResultSet result = new ResultSet(metadata);
for (PermissionDetails pd : details)
{
result.addColumnValue(UTF8Type.instance.decompose(pd.username));
result.addColumnValue(UTF8Type.instance.decompose(pd.resource.toString()));
result.addColumnValue(UTF8Type.instance.decompose(pd.permission.toString()));
}
return new ResultMessage.Rows(result);
}
示例4: 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();
}
示例5: 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);
}
}
示例6: processStatement
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
private static ResultMessage processStatement(CQLStatement statement, QueryState queryState, QueryOptions options)
throws RequestExecutionException, RequestValidationException
{
logger.trace("Process {} @CL.{}", statement, options.getConsistency());
ClientState clientState = queryState.getClientState();
statement.checkAccess(clientState);
statement.validate(clientState);
ResultMessage result = statement.execute(queryState, options);
return result == null ? new ResultMessage.Void() : result;
}
示例7: processBatch
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public static ResultMessage processBatch(BatchStatement batch, ConsistencyLevel cl, QueryState queryState, List<List<ByteBuffer>> variables)
throws RequestExecutionException, RequestValidationException
{
ClientState clientState = queryState.getClientState();
batch.checkAccess(clientState);
batch.validate(clientState);
batch.executeWithPerStatementVariables(cl, queryState, variables);
return new ResultMessage.Void();
}
示例8: resultMessage
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
private ResultMessage resultMessage(Set<RoleResource> roles)
{
if (roles.isEmpty())
return new ResultMessage.Void();
List<RoleResource> sorted = Lists.newArrayList(roles);
Collections.sort(sorted);
return formatResults(sorted);
}
示例9: executeInternal
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
public ResultMessage executeInternal(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
{
if (hasConditions)
return executeInternalWithConditions(BatchQueryOptions.withoutPerStatementVariables(options), queryState);
executeInternalWithoutCondition(queryState, options);
return new ResultMessage.Void();
}
示例10: resultMessage
import org.apache.cassandra.transport.messages.ResultMessage; //导入方法依赖的package包/类
private ResultMessage resultMessage(List<PermissionDetails> details)
{
if (details.isEmpty())
return new ResultMessage.Void();
ResultSet result = new ResultSet(metadata);
for (PermissionDetails pd : details)
{
result.addColumnValue(UTF8Type.instance.decompose(pd.grantee));
result.addColumnValue(UTF8Type.instance.decompose(pd.grantee));
result.addColumnValue(UTF8Type.instance.decompose(pd.resource.toString()));
result.addColumnValue(UTF8Type.instance.decompose(pd.permission.toString()));
}
return new ResultMessage.Rows(result);
}
示例11: 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);
}
示例12: 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);
}