Example usage for org.apache.cassandra.cql3 QueryOptions prepare

List of usage examples for org.apache.cassandra.cql3 QueryOptions prepare

Introduction

In this page you can find the example usage for org.apache.cassandra.cql3 QueryOptions prepare.

Prototype

public QueryOptions prepare(List<ColumnSpecification> specs) 

Source Link

Usage

From source file:com.stratio.cassandra.lucene.IndexQueryHandler.java

License:Apache License

@Override
/** {@inheritDoc} */
public ResultMessage process(String query, QueryState state, QueryOptions options,
        Map<String, ByteBuffer> customPayload) {
    ParsedStatement.Prepared p = QueryProcessor.getStatement(query, state.getClientState());
    options.prepare(p.boundNames);
    CQLStatement prepared = p.statement;
    if (prepared.getBoundTerms() != options.getValues().size()) {
        throw new InvalidRequestException("Invalid amount of bind variables");
    }//from  www.  jav a  2 s  . c o m

    if (!state.getClientState().isInternal) {
        QueryProcessor.metrics.regularStatementsExecuted.inc();
    }

    return processStatement(prepared, state, options);
}