Java 类org.apache.cassandra.thrift.CqlPreparedResult 实例源码

项目:cassandra-kmean    文件:QueryProcessor.java   
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws RequestValidationException
{
    logger.trace("CQL QUERY: {}", queryString);

    CQLStatement statement = getStatement(queryString);
    int statementId = makeStatementId(queryString);
    logger.trace("Discovered "+ statement.boundTerms + " bound variables.");

    clientState.getPrepared().put(statementId, statement);
    logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                               statementId,
                               statement.boundTerms));

    if (!postPreparationHooks.isEmpty())
    {
        PreparationContext context = new PreparationContext(clientState, queryString, statement);
        for (PostPreparationHook hook : postPreparationHooks)
            hook.processStatement(statement, context);
    }

    return new CqlPreparedResult(statementId, statement.boundTerms);
}
项目:ACaZoo    文件:QueryProcessor.java   
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws SyntaxException
{
    logger.trace("CQL QUERY: {}", queryString);

    CQLStatement statement = getStatement(queryString);
    int statementId = makeStatementId(queryString);
    logger.trace("Discovered "+ statement.boundTerms + " bound variables.");

    clientState.getPrepared().put(statementId, statement);
    logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                               statementId,
                               statement.boundTerms));

    return new CqlPreparedResult(statementId, statement.boundTerms);
}
项目:Cassandra-Wasef    文件:QueryProcessor.java   
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws InvalidRequestException, SyntaxException
{
    logger.trace("CQL QUERY: {}", queryString);

    CQLStatement statement = getStatement(queryString);
    int statementId = makeStatementId(queryString);
    logger.trace("Discovered "+ statement.boundTerms + " bound variables.");

    clientState.getPrepared().put(statementId, statement);
    logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                               statementId,
                               statement.boundTerms));

    return new CqlPreparedResult(statementId, statement.boundTerms);
}
项目:stratio-cassandra    文件:QueryProcessor.java   
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws RequestValidationException
{
    logger.trace("CQL QUERY: {}", queryString);

    CQLStatement statement = getStatement(queryString);
    int statementId = makeStatementId(queryString);
    logger.trace("Discovered "+ statement.boundTerms + " bound variables.");

    clientState.getPrepared().put(statementId, statement);
    logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                               statementId,
                               statement.boundTerms));

    if (!postPreparationHooks.isEmpty())
    {
        PreparationContext context = new PreparationContext(clientState, queryString, statement);
        for (PostPreparationHook hook : postPreparationHooks)
            hook.processStatement(statement, context);
    }

    return new CqlPreparedResult(statementId, statement.boundTerms);
}
项目:cassandra-cqlMod    文件:QueryProcessor.java   
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws RequestValidationException
{
    logger.trace("CQL QUERY: {}", queryString);

    CQLStatement statement = getStatement(queryString);
    int statementId = makeStatementId(queryString);
    logger.trace("Discovered "+ statement.boundTerms + " bound variables.");

    clientState.getPrepared().put(statementId, statement);
    logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                               statementId,
                               statement.boundTerms));

    if (!postPreparationHooks.isEmpty())
    {
        PreparationContext context = new PreparationContext(clientState, queryString, statement);
        for (PostPreparationHook hook : postPreparationHooks)
            hook.processStatement(statement, context);
    }

    return new CqlPreparedResult(statementId, statement.boundTerms);
}
项目:wso2-cassandra    文件:QueryProcessor.java   
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws InvalidRequestException, SyntaxException
{
    logger.trace("CQL QUERY: {}", queryString);

    CQLStatement statement = getStatement(queryString);
    int statementId = makeStatementId(queryString);
    logger.trace("Discovered "+ statement.boundTerms + " bound variables.");

    clientState.getPrepared().put(statementId, statement);
    logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                               statementId,
                               statement.boundTerms));

    return new CqlPreparedResult(statementId, statement.boundTerms);
}
项目:cassandra-1.2.16    文件:QueryProcessor.java   
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
throws InvalidRequestException, SyntaxException
{
    logger.trace("CQL QUERY: {}", queryString);

    CQLStatement statement = getStatement(queryString);
    int statementId = makeStatementId(queryString);
    logger.trace("Discovered "+ statement.boundTerms + " bound variables.");

    clientState.getPrepared().put(statementId, statement);
    logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                               statementId,
                               statement.boundTerms));

    return new CqlPreparedResult(statementId, statement.boundTerms);
}
项目:cassandra-kmean    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:ACaZoo    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:ACaZoo    文件:Operation.java   
protected Integer getPreparedStatement(CassandraClient client, String cqlQuery) throws Exception
{
    Integer statementId = client.preparedStatements.get(cqlQuery.hashCode());
    if (statementId == null)
    {
        CqlPreparedResult response = session.cqlVersion.startsWith("3")
                                   ? client.prepare_cql3_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE)
                                   : client.prepare_cql_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE);
        statementId = response.itemId;
        client.preparedStatements.put(cqlQuery.hashCode(), statementId);
    }

    return statementId;
}
项目:scylla-tools-java    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:GraphTrek    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:Cassandra-Wasef    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:Cassandra-Wasef    文件:Operation.java   
protected Integer getPreparedStatement(CassandraClient client, String cqlQuery) throws Exception
{
    Integer statementId = client.preparedStatements.get(cqlQuery.hashCode());
    if (statementId == null)
    {
        CqlPreparedResult response = session.cqlVersion.startsWith("3")
                                   ? client.prepare_cql3_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE)
                                   : client.prepare_cql_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE);
        statementId = response.itemId;
        client.preparedStatements.put(cqlQuery.hashCode(), statementId);
    }

    return statementId;
}
项目:stratio-cassandra    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:cassandra-cqlMod    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:wso2-cassandra    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:wso2-cassandra    文件:Operation.java   
protected Integer getPreparedStatement(CassandraClient client, String cqlQuery) throws Exception
{
    Integer statementId = client.preparedStatements.get(cqlQuery.hashCode());
    if (statementId == null)
    {
        CqlPreparedResult response = session.cqlVersion.startsWith("3")
                                   ? client.prepare_cql3_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE)
                                   : client.prepare_cql_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE);
        statementId = response.itemId;
        client.preparedStatements.put(cqlQuery.hashCode(), statementId);
    }

    return statementId;
}
项目:cassandra-trunk    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:cassandra-1.2.16    文件:ResultMessage.java   
public CqlPreparedResult toThriftPreparedResult()
{
    List<String> namesString = new ArrayList<String>(metadata.names.size());
    List<String> typesString = new ArrayList<String>(metadata.names.size());
    for (ColumnSpecification name : metadata.names)
    {
        namesString.add(name.toString());
        typesString.add(name.type.toString());
    }
    return new CqlPreparedResult(thriftStatementId, metadata.names.size()).setVariable_types(typesString).setVariable_names(namesString);
}
项目:cassandra-1.2.16    文件:Operation.java   
protected Integer getPreparedStatement(CassandraClient client, String cqlQuery) throws Exception
{
    Integer statementId = client.preparedStatements.get(cqlQuery.hashCode());
    if (statementId == null)
    {
        CqlPreparedResult response = session.cqlVersion.startsWith("3")
                                   ? client.prepare_cql3_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE)
                                   : client.prepare_cql_query(ByteBufferUtil.bytes(cqlQuery), Compression.NONE);
        statementId = response.itemId;
        client.preparedStatements.put(cqlQuery.hashCode(), statementId);
    }

    return statementId;
}