本文整理汇总了Java中org.apache.cassandra.cql3.QueryProcessor.processPrepared方法的典型用法代码示例。如果您正苦于以下问题:Java QueryProcessor.processPrepared方法的具体用法?Java QueryProcessor.processPrepared怎么用?Java QueryProcessor.processPrepared使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.cql3.QueryProcessor
的用法示例。
在下文中一共展示了QueryProcessor.processPrepared方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.cassandra.cql3.QueryProcessor; //导入方法依赖的package包/类
public Message.Response execute(QueryState state)
{
try
{
CQLStatement statement = QueryProcessor.getPrepared(statementId);
if (statement == null)
throw new PreparedQueryNotFoundException(statementId);
if (options.getPageSize() == 0)
throw new ProtocolException("The page size cannot be 0");
UUID tracingId = null;
if (isTracingRequested())
{
tracingId = UUIDGen.getTimeUUID();
state.prepareTracingSession(tracingId);
}
if (state.traceNextQuery())
{
state.createTracingSession();
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
if (options.getPageSize() > 0)
builder.put("page_size", Integer.toString(options.getPageSize()));
// TODO we don't have [typed] access to CQL bind variables here. CASSANDRA-4560 is open to add support.
Tracing.instance.begin("Execute CQL3 prepared query", builder.build());
}
Message.Response response = QueryProcessor.processPrepared(statement, state, options);
if (options.skipMetadata() && response instanceof ResultMessage.Rows)
((ResultMessage.Rows)response).result.metadata.setSkipMetadata();
if (tracingId != null)
response.setTracingId(tracingId);
return response;
}
catch (Exception e)
{
return ErrorMessage.fromException(e);
}
finally
{
Tracing.instance.stopSession();
}
}