public ResultMessage.Prepared prepare(String queryString, QueryState queryState) { ClientState cState = queryState.getClientState(); return prepare(queryString, cState, cState instanceof ThriftClientState); }
public ResultMessage.Prepared prepare(String queryString, QueryState queryState) { ClientState cState = queryState.getClientState(); return prepare(queryString, cState, cState instanceof ThriftClientState); }
public ResultMessage.Prepared prepare(String queryString, QueryState queryState) throws RequestValidationException { ClientState cState = queryState.getClientState(); return prepare(queryString, cState, cState instanceof ThriftClientState); }
public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws InvalidRequestException { state.getClientState().setKeyspace(keyspace); return new ResultMessage.SetKeyspace(keyspace); }
public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws InvalidRequestException { state.getClientState().setKeyspace(keyspace); return new ResultMessage.SetKeyspace(keyspace); }
private Query createGenericQuery(final long startTime, final long execTime, final String queryString, final CQLStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UNKNOWN, "", "", queryString, extractConsistencyLevel(options)); }
private Query createGenericQuery(final long startTime, final long execTime, final String queryString, final CQLStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UNKNOWN, "", "", queryString, extractConsistencyLevel(options)); }
public static ParsedStatement.Prepared prepareInternal(String query) throws RequestValidationException { ParsedStatement.Prepared prepared = internalStatements.get(query); if (prepared != null) return prepared; // Note: if 2 threads prepare the same query, we'll live so don't bother synchronizing prepared = parseStatement(query, internalQueryState()); prepared.statement.validate(internalQueryState().getClientState()); internalStatements.putIfAbsent(query, prepared); return prepared; }
public static ParsedStatement.Prepared prepareInternal(String query) throws RequestValidationException { ParsedStatement.Prepared prepared = internalStatements.get(query); if (prepared != null) return prepared; // Note: if 2 threads prepare the same query, we'll live so don't bother synchronizing prepared = parseStatement(query, internalQueryState()); prepared.statement.validate(internalQueryState().getClientState()); internalStatements.putIfAbsent(query, prepared); return prepared; }
private ResultMessage.Rows execute(ReadQuery query, QueryOptions options, QueryState state, int nowInSec, int userLimit, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { try (PartitionIterator data = query.execute(options.getConsistency(), state.getClientState(), queryStartNanoTime)) { return processResults(data, options, nowInSec, userLimit); } }
private ResultMessage.Rows execute(ReadQuery query, QueryOptions options, QueryState state, int nowInSec, int userLimit, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { try (PartitionIterator data = query.execute(options.getConsistency(), state.getClientState(), queryStartNanoTime)) { return processResults(data, options, nowInSec, userLimit); } }
public ResultMessage processStatement(CQLStatement statement, QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException { logger.trace("Process {} @CL.{}", statement, options.getConsistency()); ClientState clientState = queryState.getClientState(); statement.checkAccess(clientState); statement.validate(clientState); ResultMessage result = statement.execute(queryState, options, queryStartNanoTime); return result == null ? new ResultMessage.Void() : result; }
public ResultMessage processStatement(CQLStatement statement, QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException { logger.trace("Process {} @CL.{}", statement, options.getConsistency()); ClientState clientState = queryState.getClientState(); statement.checkAccess(clientState); statement.validate(clientState); ResultMessage result = statement.execute(queryState, options, queryStartNanoTime); return result == null ? new ResultMessage.Void() : result; }
private Query createQuery(final long startTime, final long execTime, final String queryString, final SelectStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.SELECT, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
private Query createQuery(final long startTime, final long execTime, final String queryString, final ModificationStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UPDATE, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
private Query createQuery(final long startTime, final long execTime, final String queryString, final SelectStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.SELECT, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
private Query createQuery(final long startTime, final long execTime, final String queryString, final ModificationStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UPDATE, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
public ResultMessage processBatch(BatchStatement batch, QueryState queryState, BatchQueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException { ClientState clientState = queryState.getClientState(); batch.checkAccess(clientState); batch.validate(); batch.validate(clientState); return batch.execute(queryState, options, queryStartNanoTime); }
public ResultMessage processBatch(BatchStatement batch, QueryState queryState, BatchQueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException { ClientState clientState = queryState.getClientState(); batch.checkAccess(clientState); batch.validate(); batch.validate(clientState); return batch.execute(queryState, options, queryStartNanoTime); }
public ResultMessage processBatch(BatchStatement batch, QueryState queryState, BatchQueryOptions options) throws RequestExecutionException, RequestValidationException { ClientState clientState = queryState.getClientState(); batch.checkAccess(clientState); batch.validate(); batch.validate(clientState); return batch.execute(queryState, options); }