public class QueryProcessor extends java.lang.Object implements QueryHandler
| Modifier and Type | Field and Description |
|---|---|
static CassandraVersion |
CQL_VERSION |
static QueryProcessor |
instance |
static CQLMetrics |
metrics |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearInternalStatementsCache()
Clear our internal statmeent cache for test purposes.
|
static void |
clearPreparedStatements(boolean memoryOnly)
Clears the prepared statement cache.
|
static UntypedResultSet |
execute(java.lang.String query,
ConsistencyLevel cl,
java.lang.Object... values) |
static UntypedResultSet |
execute(java.lang.String query,
ConsistencyLevel cl,
QueryState state,
java.lang.Object... values) |
static UntypedResultSet |
executeInternal(java.lang.String query,
java.lang.Object... values) |
static UntypedResultSet |
executeInternalWithNow(int nowInSec,
long queryStartNanoTime,
java.lang.String query,
java.lang.Object... values)
A special version of executeInternal that takes the time used as "now" for the query in argument.
|
static UntypedResultSet |
executeInternalWithPaging(java.lang.String query,
int pageSize,
java.lang.Object... values) |
static UntypedResultSet |
executeOnceInternal(java.lang.String query,
java.lang.Object... values)
Same than executeInternal, but to use for queries we know are only executed once so that the
created statement object is not cached.
|
ParsedStatement.Prepared |
getPrepared(MD5Digest id) |
ParsedStatement.Prepared |
getPreparedForThrift(java.lang.Integer id) |
static ParsedStatement.Prepared |
getStatement(java.lang.String queryStr,
ClientState clientState) |
static ParsedStatement |
parseStatement(java.lang.String queryStr) |
static <T extends ParsedStatement> |
parseStatement(java.lang.String queryStr,
java.lang.Class<T> klass,
java.lang.String type) |
static ParsedStatement.Prepared |
parseStatement(java.lang.String queryStr,
QueryState queryState) |
static void |
preloadPreparedStatement() |
static ResultMessage.Prepared |
prepare(java.lang.String queryString,
ClientState clientState,
boolean forThrift) |
ResultMessage.Prepared |
prepare(java.lang.String queryString,
QueryState queryState) |
ResultMessage.Prepared |
prepare(java.lang.String query,
QueryState state,
java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload) |
static int |
preparedStatementsCount() |
static ParsedStatement.Prepared |
prepareInternal(java.lang.String query) |
static UntypedResultSet |
process(java.lang.String query,
ConsistencyLevel cl) |
static UntypedResultSet |
process(java.lang.String query,
ConsistencyLevel cl,
java.util.List<java.nio.ByteBuffer> values) |
static ResultMessage |
process(java.lang.String queryString,
ConsistencyLevel cl,
QueryState queryState,
long queryStartNanoTime) |
ResultMessage |
process(java.lang.String queryString,
QueryState queryState,
QueryOptions options,
long queryStartNanoTime) |
ResultMessage |
process(java.lang.String query,
QueryState state,
QueryOptions options,
java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload,
long queryStartNanoTime) |
ResultMessage |
processBatch(BatchStatement batch,
QueryState queryState,
BatchQueryOptions options,
long queryStartNanoTime) |
ResultMessage |
processBatch(BatchStatement statement,
QueryState state,
BatchQueryOptions options,
java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload,
long queryStartNanoTime) |
ResultMessage |
processPrepared(CQLStatement statement,
QueryState queryState,
QueryOptions options,
long queryStartNanoTime) |
ResultMessage |
processPrepared(CQLStatement statement,
QueryState state,
QueryOptions options,
java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload,
long queryStartNanoTime) |
ResultMessage |
processStatement(CQLStatement statement,
QueryState queryState,
QueryOptions options,
long queryStartNanoTime) |
static UntypedResultSet |
resultify(java.lang.String query,
PartitionIterator partitions) |
static UntypedResultSet |
resultify(java.lang.String query,
RowIterator partition) |
static void |
validateKey(java.nio.ByteBuffer key) |
public static final CassandraVersion CQL_VERSION
public static final QueryProcessor instance
public static final CQLMetrics metrics
public static int preparedStatementsCount()
public static void preloadPreparedStatement()
public static void clearPreparedStatements(boolean memoryOnly)
memoryOnly - true if only the in memory caches must be cleared, false otherwise.public ParsedStatement.Prepared getPrepared(MD5Digest id)
getPrepared in interface QueryHandlerpublic ParsedStatement.Prepared getPreparedForThrift(java.lang.Integer id)
getPreparedForThrift in interface QueryHandlerpublic static void validateKey(java.nio.ByteBuffer key)
throws InvalidRequestException
InvalidRequestExceptionpublic ResultMessage processStatement(CQLStatement statement, QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
public static ResultMessage process(java.lang.String queryString, ConsistencyLevel cl, QueryState queryState, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
public ResultMessage process(java.lang.String query, QueryState state, QueryOptions options, java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
process in interface QueryHandlerRequestExecutionExceptionRequestValidationExceptionpublic ResultMessage process(java.lang.String queryString, QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
public static ParsedStatement.Prepared parseStatement(java.lang.String queryStr, QueryState queryState) throws RequestValidationException
RequestValidationExceptionpublic static UntypedResultSet process(java.lang.String query, ConsistencyLevel cl) throws RequestExecutionException
RequestExecutionExceptionpublic static UntypedResultSet process(java.lang.String query, ConsistencyLevel cl, java.util.List<java.nio.ByteBuffer> values) throws RequestExecutionException
RequestExecutionExceptionpublic static ParsedStatement.Prepared prepareInternal(java.lang.String query) throws RequestValidationException
RequestValidationExceptionpublic static UntypedResultSet executeInternal(java.lang.String query, java.lang.Object... values)
public static UntypedResultSet execute(java.lang.String query, ConsistencyLevel cl, java.lang.Object... values) throws RequestExecutionException
RequestExecutionExceptionpublic static UntypedResultSet execute(java.lang.String query, ConsistencyLevel cl, QueryState state, java.lang.Object... values) throws RequestExecutionException
RequestExecutionExceptionpublic static UntypedResultSet executeInternalWithPaging(java.lang.String query, int pageSize, java.lang.Object... values)
public static UntypedResultSet executeOnceInternal(java.lang.String query, java.lang.Object... values)
public static UntypedResultSet executeInternalWithNow(int nowInSec, long queryStartNanoTime, java.lang.String query, java.lang.Object... values)
public static UntypedResultSet resultify(java.lang.String query, RowIterator partition)
public static UntypedResultSet resultify(java.lang.String query, PartitionIterator partitions)
public ResultMessage.Prepared prepare(java.lang.String query, QueryState state, java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload) throws RequestValidationException
prepare in interface QueryHandlerRequestValidationExceptionpublic ResultMessage.Prepared prepare(java.lang.String queryString, QueryState queryState)
public static ResultMessage.Prepared prepare(java.lang.String queryString, ClientState clientState, boolean forThrift)
public ResultMessage processPrepared(CQLStatement statement, QueryState state, QueryOptions options, java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
processPrepared in interface QueryHandlerRequestExecutionExceptionRequestValidationExceptionpublic ResultMessage processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
public ResultMessage processBatch(BatchStatement statement, QueryState state, BatchQueryOptions options, java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
processBatch in interface QueryHandlerRequestExecutionExceptionRequestValidationExceptionpublic ResultMessage processBatch(BatchStatement batch, QueryState queryState, BatchQueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
public static ParsedStatement.Prepared getStatement(java.lang.String queryStr, ClientState clientState) throws RequestValidationException
RequestValidationExceptionpublic static <T extends ParsedStatement> T parseStatement(java.lang.String queryStr, java.lang.Class<T> klass, java.lang.String type) throws SyntaxException
SyntaxExceptionpublic static ParsedStatement parseStatement(java.lang.String queryStr) throws SyntaxException
SyntaxExceptionpublic static void clearInternalStatementsCache()
Copyright © 2018 The Apache Software Foundation