Java Code Examples for org.apache.cassandra.transport.messages.ResultMessage#Prepared

The following examples show how to use org.apache.cassandra.transport.messages.ResultMessage#Prepared . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QueryProcessor.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
public static ResultMessage.Prepared prepare(String queryString, ClientState clientState, boolean forThrift)
throws RequestValidationException
{
    ResultMessage.Prepared existing = getStoredPreparedStatement(queryString, clientState.getRawKeyspace(), forThrift);
    if (existing != null)
        return existing;

    ParsedStatement.Prepared prepared = getStatement(queryString, clientState);
    int boundTerms = prepared.statement.getBoundTerms();
    if (boundTerms > FBUtilities.MAX_UNSIGNED_SHORT)
        throw new InvalidRequestException(String.format("Too many markers(?). %d markers exceed the allowed maximum of %d", boundTerms, FBUtilities.MAX_UNSIGNED_SHORT));
    assert boundTerms == prepared.boundNames.size();

    return storePreparedStatement(queryString, clientState.getRawKeyspace(), prepared, forThrift);
}
 
Example 2
Source File: QueryProcessor.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
public ResultMessage.Prepared prepare(String queryString, QueryState queryState)
throws RequestValidationException
{
    ClientState cState = queryState.getClientState();
    return prepare(queryString, cState, cState instanceof ThriftClientState);
}
 
Example 3
Source File: SimpleClient.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
public ResultMessage.Prepared prepare(String query)
{
    Message.Response msg = execute(new PrepareMessage(query));
    assert msg instanceof ResultMessage.Prepared;
    return (ResultMessage.Prepared)msg;
}
 
Example 4
Source File: QueryHandler.java    From stratio-cassandra with Apache License 2.0 votes vote down vote up
public ResultMessage.Prepared prepare(String query, QueryState state) throws RequestValidationException;