use of org.apache.cassandra.transport.messages.ResultMessage in project cassandra by apache.
the class QueryProcessor method executeOnceInternal.
/**
* Same than executeInternal, but to use for queries we know are only executed once so that the
* created statement object is not cached.
*/
public static UntypedResultSet executeOnceInternal(String query, Object... values) {
ParsedStatement.Prepared prepared = parseStatement(query, internalQueryState());
prepared.statement.validate(internalQueryState().getClientState());
ResultMessage result = prepared.statement.executeInternal(internalQueryState(), makeInternalOptions(prepared, values));
if (result instanceof ResultMessage.Rows)
return UntypedResultSet.create(((ResultMessage.Rows) result).result);
else
return null;
}
use of org.apache.cassandra.transport.messages.ResultMessage in project cassandra by apache.
the class CQLTester method assertSchemaChange.
protected static void assertSchemaChange(String query, Event.SchemaChange.Change expectedChange, Event.SchemaChange.Target expectedTarget, String expectedKeyspace, String expectedName, String... expectedArgTypes) {
ResultMessage actual = schemaChange(query);
Assert.assertTrue(actual instanceof ResultMessage.SchemaChange);
Event.SchemaChange schemaChange = ((ResultMessage.SchemaChange) actual).change;
Assert.assertSame(expectedChange, schemaChange.change);
Assert.assertSame(expectedTarget, schemaChange.target);
Assert.assertEquals(expectedKeyspace, schemaChange.keyspace);
Assert.assertEquals(expectedName, schemaChange.name);
Assert.assertEquals(expectedArgTypes != null ? Arrays.asList(expectedArgTypes) : null, schemaChange.argTypes);
}
use of org.apache.cassandra.transport.messages.ResultMessage in project cassandra by apache.
the class QueryProcessor method executeInternal.
public static UntypedResultSet executeInternal(String query, Object... values) {
Prepared prepared = prepareInternal(query);
ResultMessage result = prepared.statement.executeLocally(internalQueryState(), makeInternalOptions(prepared.statement, values));
if (result instanceof ResultMessage.Rows)
return UntypedResultSet.create(((ResultMessage.Rows) result).result);
else
return null;
}
use of org.apache.cassandra.transport.messages.ResultMessage in project cassandra by apache.
the class CustomPayloadMirroringQueryHandler method process.
public ResultMessage process(CQLStatement statement, QueryState state, QueryOptions options, Map<String, ByteBuffer> customPayload, long queryStartNanoTime) {
ResultMessage result = queryProcessor.process(statement, state, options, customPayload, queryStartNanoTime);
result.setCustomPayload(customPayload);
return result;
}
use of org.apache.cassandra.transport.messages.ResultMessage in project cassandra by apache.
the class CustomPayloadMirroringQueryHandler method processPrepared.
public ResultMessage processPrepared(CQLStatement statement, QueryState state, QueryOptions options, Map<String, ByteBuffer> customPayload, long queryStartNanoTime) {
ResultMessage result = queryProcessor.processPrepared(statement, state, options, customPayload, queryStartNanoTime);
result.setCustomPayload(customPayload);
return result;
}
Aggregations