Package org.apache.cassandra.cql3

Examples of org.apache.cassandra.cql3.QueryOptions


        return (ResultMessage)msg;
    }

    public ResultMessage execute(String query, List<ByteBuffer> values, ConsistencyLevel consistencyLevel)
    {
        Message.Response msg = execute(new QueryMessage(query, new QueryOptions(consistencyLevel, values)));
        assert msg instanceof ResultMessage;
        return (ResultMessage)msg;
    }
View Full Code Here


        return (ResultMessage.Prepared)msg;
    }

    public ResultMessage executePrepared(byte[] statementId, List<ByteBuffer> values, ConsistencyLevel consistency)
    {
        Message.Response msg = execute(new ExecuteMessage(MD5Digest.wrap(statementId), new QueryOptions(consistency, values)));
        assert msg instanceof ResultMessage;
        return (ResultMessage)msg;
    }
View Full Code Here

        UntypedResultSet result;
        try
        {
            ResultMessage.Rows rows = authorizeStatement.execute(new QueryState(new ClientState(true)),
                                                                 new QueryOptions(ConsistencyLevel.ONE,
                                                                                  Lists.newArrayList(ByteBufferUtil.bytes(user.getName()),
                                                                                                     ByteBufferUtil.bytes(resource.getName()))));
            result = new UntypedResultSet(rows.result);
        }
        catch (RequestValidationException e)
View Full Code Here

        UntypedResultSet result;
        try
        {
            ResultMessage.Rows rows = authenticateStatement.execute(new QueryState(new ClientState(true)),
                                                                    new QueryOptions(consistencyForUser(username),
                                                                                     Lists.newArrayList(ByteBufferUtil.bytes(username))));
            result = new UntypedResultSet(rows.result);
        }
        catch (RequestValidationException e)
        {
View Full Code Here

    private static UntypedResultSet selectUser(String username)
    {
        try
        {
            ResultMessage.Rows rows = selectUserStatement.execute(new QueryState(new ClientState(true)),
                                                                  new QueryOptions(consistencyForUser(username), Lists.newArrayList(ByteBufferUtil.bytes(username))));
            return new UntypedResultSet(rows.result);
        }
        catch (RequestValidationException e)
        {
            throw new AssertionError(e); // not supposed to happen
View Full Code Here

                                                                itemId));
            logger.trace("Retrieved prepared statement #{} with {} bind markers", itemId, statement.getBoundsTerms());

            return org.apache.cassandra.cql3.QueryProcessor.processPrepared(statement,
                                                                            cState.getQueryState(),
                                                                            new QueryOptions(ThriftConversion.fromThrift(cLevel), bindVariables)).toThriftResult();
        }
        catch (RequestExecutionException e)
        {
            throw ThriftConversion.rethrow(e);
        }
View Full Code Here

    public final String query;
    public final QueryOptions options;

    public QueryMessage(String query, ConsistencyLevel consistency)
    {
        this(query, new QueryOptions(consistency, Collections.<ByteBuffer>emptyList()));
    }
View Full Code Here

    public final MD5Digest statementId;
    public final QueryOptions options;

    public ExecuteMessage(byte[] statementId, List<ByteBuffer> values, ConsistencyLevel consistency)
    {
        this(MD5Digest.wrap(statementId), new QueryOptions(consistency, values));
    }
View Full Code Here

        UntypedResultSet result;
        try
        {
            ResultMessage.Rows rows = authorizeStatement.execute(new QueryState(new ClientState(true)),
                                                                 new QueryOptions(ConsistencyLevel.ONE,
                                                                                  Lists.newArrayList(ByteBufferUtil.bytes(user.getName()),
                                                                                                     ByteBufferUtil.bytes(resource.getName()))));
            result = new UntypedResultSet(rows.result);
        }
        catch (RequestValidationException e)
View Full Code Here

        UntypedResultSet result;
        try
        {
            ResultMessage.Rows rows = authenticateStatement.execute(new QueryState(new ClientState(true)),
                                                                    new QueryOptions(consistencyForUser(username),
                                                                                     Lists.newArrayList(ByteBufferUtil.bytes(username))));
            result = new UntypedResultSet(rows.result);
        }
        catch (RequestValidationException e)
        {
View Full Code Here

TOP

Related Classes of org.apache.cassandra.cql3.QueryOptions

Copyright © 2018 www.massapicom. 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.