Examples of CQLStatement


Examples of org.apache.cassandra.cql.CQLStatement

        }

        try
        {
            ThriftClientState cState = state();
            CQLStatement statement = cState.getPrepared().get(itemId);

            if (statement == null)
                throw new InvalidRequestException(String.format("Prepared query with ID %d not found", itemId));
            logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId, statement.boundTerms);
View Full Code Here

Examples of org.apache.cassandra.cql.CQLStatement

        }

        try
        {
            ThriftClientState cState = state();
            CQLStatement statement = cState.getPrepared().get(itemId);

            if (statement == null)
                throw new InvalidRequestException(String.format("Prepared query with ID %d not found", itemId));
            logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId, statement.boundTerms);
View Full Code Here

Examples of org.apache.cassandra.cql.CQLStatement

        }

        try
        {
            ThriftClientState cState = state();
            CQLStatement statement = cState.getPrepared().get(itemId);

            if (statement == null)
                throw new InvalidRequestException(String.format("Prepared query with ID %d not found", itemId));
            logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId, statement.boundTerms);
View Full Code Here

Examples of org.apache.cassandra.cql.CQLStatement

        try
        {
            ClientState cState = state();
            if (cState.getCQLVersion().major == 2)
            {
                CQLStatement statement = cState.getPrepared().get(itemId);

                if (statement == null)
                    throw new InvalidRequestException(String.format("Prepared query with ID %d not found", itemId));
                logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId, statement.boundTerms);

                return QueryProcessor.processPrepared(statement, cState, bindVariables);
            }
            else
            {
                org.apache.cassandra.cql3.CQLStatement statement = cState.getCQL3Prepared().get(itemId);

                if (statement == null)
                    throw new InvalidRequestException(String.format("Prepared query with ID %d not found", itemId));
                logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId,
                        statement.getBoundsTerms());

                return org.apache.cassandra.cql3.QueryProcessor.processPrepared(statement, cState, bindVariables).toThriftResult();
            }
        }
        catch (RequestExecutionException e)
View Full Code Here

Examples of org.apache.cassandra.cql3.CQLStatement

            List<ModificationStatement> statements = new ArrayList<ModificationStatement>(queryOrIdList.size());
            for (int i = 0; i < queryOrIdList.size(); i++)
            {
                Object query = queryOrIdList.get(i);
                CQLStatement statement;
                if (query instanceof String)
                {
                    statement = QueryProcessor.parseStatement((String)query, state);
                }
                else
                {
                    statement = QueryProcessor.getPrepared((MD5Digest)query);
                    if (statement == null)
                        throw new PreparedQueryNotFoundException((MD5Digest)query);
                }

                List<ByteBuffer> queryValues = values.get(i);
                if (queryValues.size() != statement.getBoundsTerms())
                    throw new InvalidRequestException(String.format("There were %d markers(?) in CQL but %d bound variables",
                                                                    statement.getBoundsTerms(),
                                                                    queryValues.size()));
                if (!(statement instanceof ModificationStatement))
                    throw new InvalidRequestException("Invalid statement in batch: only UPDATE, INSERT and DELETE statements are allowed.");

                ModificationStatement mst = (ModificationStatement)statement;
View Full Code Here

Examples of org.apache.cassandra.cql3.CQLStatement

            ParsedStatement.Prepared prepared = handler.getPrepared(statementId);
            if (prepared == null)
                throw new PreparedQueryNotFoundException(statementId);

            options.prepare(prepared.boundNames);
            CQLStatement statement = prepared.statement;

            if (options.getPageSize() == 0)
                throw new ProtocolException("The page size cannot be 0");

            UUID tracingId = null;
View Full Code Here

Examples of org.apache.cassandra.cql3.CQLStatement

    public Message.Response execute(QueryState state)
    {
        try
        {
            CQLStatement statement = QueryProcessor.getPrepared(statementId);

            if (statement == null)
                throw new PreparedQueryNotFoundException(statementId);

            if (options.getPageSize() == 0)
View Full Code Here

Examples of org.apache.cassandra.cql3.CQLStatement

    public Message.Response execute(QueryState state)
    {
        try
        {
            CQLStatement statement = QueryProcessor.getPrepared(statementId);

            if (statement == null)
                throw new PreparedQueryNotFoundException(statementId);

            if (options.getPageSize() == 0)
View Full Code Here

Examples of org.apache.cassandra.cql3.CQLStatement

            List<ModificationStatement> statements = new ArrayList<ModificationStatement>(queryOrIdList.size());
            for (int i = 0; i < queryOrIdList.size(); i++)
            {
                Object query = queryOrIdList.get(i);
                CQLStatement statement;
                if (query instanceof String)
                {
                    statement = QueryProcessor.parseStatement((String)query, state);
                }
                else
                {
                    statement = QueryProcessor.getPrepared((MD5Digest)query);
                    if (statement == null)
                        throw new PreparedQueryNotFoundException((MD5Digest)query);
                }

                List<ByteBuffer> queryValues = values.get(i);
                if (queryValues.size() != statement.getBoundTerms())
                    throw new InvalidRequestException(String.format("There were %d markers(?) in CQL but %d bound variables",
                                                                    statement.getBoundTerms(),
                                                                    queryValues.size()));
                if (!(statement instanceof ModificationStatement))
                    throw new InvalidRequestException("Invalid statement in batch: only UPDATE, INSERT and DELETE statements are allowed.");

                ModificationStatement mst = (ModificationStatement)statement;
View Full Code Here

Examples of org.apache.cassandra.cql3.CQLStatement

    public Message.Response execute(QueryState state)
    {
        try
        {
            CQLStatement statement = QueryProcessor.getPrepared(statementId);

            if (statement == null)
                throw new PreparedQueryNotFoundException(statementId);

            UUID tracingId = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.