Example usage for org.apache.cassandra.cql3 QueryProcessor metrics

List of usage examples for org.apache.cassandra.cql3 QueryProcessor metrics

Introduction

In this page you can find the example usage for org.apache.cassandra.cql3 QueryProcessor metrics.

Prototype

CQLMetrics metrics

To view the source code for org.apache.cassandra.cql3 QueryProcessor metrics.

Click Source Link

Usage

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

License:Apache License

@Override
/** {@inheritDoc} */
public ResultMessage processPrepared(CQLStatement statement, QueryState state, QueryOptions options,
        Map<String, ByteBuffer> customPayload) {
    QueryProcessor.metrics.preparedStatementsExecuted.inc();
    return processStatement(statement, state, options);
}

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);/* w  w  w  .  ja  v  a  2  s .  c  o  m*/
    CQLStatement prepared = p.statement;
    if (prepared.getBoundTerms() != options.getValues().size()) {
        throw new InvalidRequestException("Invalid amount of bind variables");
    }

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

    return processStatement(prepared, state, options);
}