org.apache.cassandra.cql3

## Class QueryProcessor

- java.lang.Object
- - org.apache.cassandra.cql3.QueryProcessor

All Implemented Interfaces:
  QueryHandler

    public class QueryProcessor
    extends java.lang.Object
    implements QueryHandler

### Field Summary

Fields
`static CassandraVersion` `CQL_VERSION`
`static QueryProcessor` `instance`
`static CQLMetrics` `metrics`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static void` `clearInternalStatementsCache()` Clear our internal statmeent cache for test purposes.
`static UntypedResultSet` `executeInternal(java.lang.String query, java.lang.Object... values)`
`static UntypedResultSet` `executeInternalWithNow(long now, 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 ParsedStatement.Prepared` `parseStatement(java.lang.String queryStr, QueryState queryState)`
`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)`
`ResultMessage` `process(java.lang.String queryString, QueryState queryState, QueryOptions options)`
`ResultMessage` `process(java.lang.String query, QueryState state, QueryOptions options, java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload)`
`ResultMessage` `processBatch(BatchStatement batch, QueryState queryState, BatchQueryOptions options)`
`ResultMessage` `processBatch(BatchStatement statement, QueryState state, BatchQueryOptions options, java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload)`
`ResultMessage` `processPrepared(CQLStatement statement, QueryState queryState, QueryOptions options)`
`ResultMessage` `processPrepared(CQLStatement statement, QueryState state, QueryOptions options, java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload)`
`ResultMessage` `processStatement(CQLStatement statement, QueryState queryState, QueryOptions options)`
`static UntypedResultSet` `resultify(java.lang.String query, java.util.List<Row> rows)`
`static UntypedResultSet` `resultify(java.lang.String query, Row row)`
`static void` `validateCellName(CellName name, CellNameType type)`
`static void` `validateCellNames(java.lang.Iterable<CellName> cellNames, CellNameType type)`
`static void` `validateComposite(Composite name, CType type)`
`static void` `validateKey(java.nio.ByteBuffer key)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### CQL_VERSION

    public static final CassandraVersion CQL_VERSION

#### instance

    public static final QueryProcessor instance

#### metrics

    public static final CQLMetrics metrics

### Method Detail

#### preparedStatementsCount

    public static int preparedStatementsCount()

#### getPrepared

    public ParsedStatement.Prepared getPrepared(MD5Digest id)

Specified by:
  `getPrepared` in interface `QueryHandler`

#### getPreparedForThrift

    public ParsedStatement.Prepared getPreparedForThrift(java.lang.Integer id)

Specified by:
  `getPreparedForThrift` in interface `QueryHandler`

#### validateKey

    public static void validateKey(java.nio.ByteBuffer key)
                            throws InvalidRequestException

Throws:
  `InvalidRequestException`

#### validateCellNames

    public static void validateCellNames(java.lang.Iterable<CellName> cellNames,
                                         CellNameType type)
                                  throws InvalidRequestException

Throws:
  `InvalidRequestException`

#### validateCellName

    public static void validateCellName(CellName name,
                                        CellNameType type)
                                 throws InvalidRequestException

Throws:
  `InvalidRequestException`

#### validateComposite

    public static void validateComposite(Composite name,
                                         CType type)
                                  throws InvalidRequestException

Throws:
  `InvalidRequestException`

#### processStatement

    public ResultMessage processStatement(CQLStatement statement,
                                          QueryState queryState,
                                          QueryOptions options)
                                   throws RequestExecutionException,
                                          RequestValidationException

Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### process

    public static ResultMessage process(java.lang.String queryString,
                                        ConsistencyLevel cl,
                                        QueryState queryState)
                                 throws RequestExecutionException,
                                        RequestValidationException

Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### process

    public ResultMessage process(java.lang.String query,
                                 QueryState state,
                                 QueryOptions options,
                                 java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload)
                          throws RequestExecutionException,
                                 RequestValidationException

Specified by:
  `process` in interface `QueryHandler`
Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### process

    public ResultMessage process(java.lang.String queryString,
                                 QueryState queryState,
                                 QueryOptions options)
                          throws RequestExecutionException,
                                 RequestValidationException

Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### parseStatement

    public static ParsedStatement.Prepared parseStatement(java.lang.String queryStr,
                                                          QueryState queryState)
                                                   throws RequestValidationException

Throws:
  `RequestValidationException`

#### process

    public static UntypedResultSet process(java.lang.String query,
                                           ConsistencyLevel cl)
                                    throws RequestExecutionException

Throws:
  `RequestExecutionException`

#### process

    public static UntypedResultSet process(java.lang.String query,
                                           ConsistencyLevel cl,
                                           java.util.List<java.nio.ByteBuffer> values)
                                    throws RequestExecutionException

Throws:
  `RequestExecutionException`

#### prepareInternal

    public static ParsedStatement.Prepared prepareInternal(java.lang.String query)
                                                    throws RequestValidationException

Throws:
  `RequestValidationException`

#### executeInternal

    public static UntypedResultSet executeInternal(java.lang.String query,
                                                   java.lang.Object... values)

#### executeInternalWithPaging

    public static UntypedResultSet executeInternalWithPaging(java.lang.String query,
                                                             int pageSize,
                                                             java.lang.Object... values)

#### executeOnceInternal

    public 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.

#### executeInternalWithNow

    public static UntypedResultSet executeInternalWithNow(long now,
                                                          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. Note that this only make sense for Selects so this only accept SELECT statements and is only useful in rare cases.

#### resultify

    public static UntypedResultSet resultify(java.lang.String query,
                                             Row row)

#### resultify

    public static UntypedResultSet resultify(java.lang.String query,
                                             java.util.List<Row> rows)

#### prepare

    public ResultMessage.Prepared prepare(java.lang.String query,
                                          QueryState state,
                                          java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload)
                                   throws RequestValidationException

Specified by:
  `prepare` in interface `QueryHandler`
Throws:
  `RequestValidationException`

#### prepare

    public ResultMessage.Prepared prepare(java.lang.String queryString,
                                          QueryState queryState)

#### prepare

    public static ResultMessage.Prepared prepare(java.lang.String queryString,
                                                 ClientState clientState,
                                                 boolean forThrift)

#### processPrepared

    public ResultMessage processPrepared(CQLStatement statement,
                                         QueryState state,
                                         QueryOptions options,
                                         java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload)
                                  throws RequestExecutionException,
                                         RequestValidationException

Specified by:
  `processPrepared` in interface `QueryHandler`
Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### processPrepared

    public ResultMessage processPrepared(CQLStatement statement,
                                         QueryState queryState,
                                         QueryOptions options)
                                  throws RequestExecutionException,
                                         RequestValidationException

Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### processBatch

    public ResultMessage processBatch(BatchStatement statement,
                                      QueryState state,
                                      BatchQueryOptions options,
                                      java.util.Map<java.lang.String,java.nio.ByteBuffer> customPayload)
                               throws RequestExecutionException,
                                      RequestValidationException

Specified by:
  `processBatch` in interface `QueryHandler`
Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### processBatch

    public ResultMessage processBatch(BatchStatement batch,
                                      QueryState queryState,
                                      BatchQueryOptions options)
                               throws RequestExecutionException,
                                      RequestValidationException

Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### getStatement

    public static ParsedStatement.Prepared getStatement(java.lang.String queryStr,
                                                        ClientState clientState)
                                                 throws RequestValidationException

Throws:
  `RequestValidationException`

#### parseStatement

    public static ParsedStatement parseStatement(java.lang.String queryStr)
                                          throws SyntaxException

Throws:
  `SyntaxException`

#### clearInternalStatementsCache

    public static void clearInternalStatementsCache()

Clear our internal statmeent cache for test purposes.