Package org.apache.cassandra.service

Examples of org.apache.cassandra.service.ClientState


                                                  QueryOptions options,
                                                  String queryString)
    throws RequestExecutionException, RequestValidationException
    {
        logger.trace("Process {} @CL.{}", statement, options.getConsistency());
        ClientState clientState = queryState.getClientState();
        statement.checkAccess(clientState);
        statement.validate(clientState);

        ResultMessage result = preExecutionHooks.isEmpty() && postExecutionHooks.isEmpty()
                             ? statement.execute(queryState, options)
View Full Code Here


    public static UntypedResultSet processInternal(String query)
    {
        try
        {
            ClientState state = ClientState.forInternalCalls();
            QueryState qState = new QueryState(state);
            state.setKeyspace(Keyspace.SYSTEM_KS);
            CQLStatement statement = getStatement(query, state).statement;
            statement.validate(state);
            ResultMessage result = statement.executeInternal(qState);
            if (result instanceof ResultMessage.Rows)
                return new UntypedResultSet(((ResultMessage.Rows)result).result);
View Full Code Here

                                             QueryState queryState,
                                             List<List<ByteBuffer>> variables,
                                             List<Object> queryOrIdList)
    throws RequestExecutionException, RequestValidationException
    {
        ClientState clientState = queryState.getClientState();
        batch.checkAccess(clientState);
        batch.validate(clientState);

        if (preExecutionHooks.isEmpty() && postExecutionHooks.isEmpty())
            batch.executeWithPerStatementVariables(cl, queryState, variables);
View Full Code Here

    }
   
    public ClientState state()
    {
        SocketAddress remoteSocket = SocketSessionManagementService.remoteSocket.get();
        ClientState retval = null;
        if (null != remoteSocket)
        {
            retval = SocketSessionManagementService.instance.get(remoteSocket);
            if (null == retval)
            {
                retval = new ClientState();
                SocketSessionManagementService.instance.put(remoteSocket, retval);
            }
        }
        else
        {
View Full Code Here

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

                                                  QueryOptions options,
                                                  String queryString)
    throws RequestExecutionException, RequestValidationException
    {
        logger.trace("Process {} @CL.{}", statement, options.getConsistency());
        ClientState clientState = queryState.getClientState();
        statement.checkAccess(clientState);
        statement.validate(clientState);

        ResultMessage result = preExecutionHooks.isEmpty() && postExecutionHooks.isEmpty()
                             ? statement.execute(queryState, options)
View Full Code Here

    public static UntypedResultSet processInternal(String query)
    {
        try
        {
            ClientState state = ClientState.forInternalCalls();
            QueryState qState = new QueryState(state);
            state.setKeyspace(Keyspace.SYSTEM_KS);
            CQLStatement statement = getStatement(query, state).statement;
            statement.validate(state);
            ResultMessage result = statement.executeInternal(qState);
            if (result instanceof ResultMessage.Rows)
                return UntypedResultSet.create(((ResultMessage.Rows)result).result);
View Full Code Here

                                             QueryState queryState,
                                             List<List<ByteBuffer>> variables,
                                             List<Object> queryOrIdList)
    throws RequestExecutionException, RequestValidationException
    {
        ClientState clientState = queryState.getClientState();
        batch.checkAccess(clientState);
        batch.validate(clientState);

        if (preExecutionHooks.isEmpty() && postExecutionHooks.isEmpty())
            batch.executeWithPerStatementVariables(cl, queryState, variables);
View Full Code Here

        this.options = options;
    }

    public Message.Response execute(QueryState state)
    {
        ClientState cState = state.getClientState();
        String cqlVersion = options.get(CQL_VERSION);
        if (cqlVersion == null)
            throw new ProtocolException("Missing value CQL_VERSION in STARTUP message");

        try
        {
            cState.setCQLVersion(cqlVersion);
        }
        catch (InvalidRequestException e)
        {
            throw new ProtocolException(e.getMessage());
        }

        if (cState.getCQLVersion().compareTo(new SemanticVersion("2.99.0")) < 0)
            throw new ProtocolException(String.format("CQL version %s is not supported by the binary protocol (supported version are >= 3.0.0)", cqlVersion));

        if (options.containsKey(COMPRESSION))
        {
            String compression = options.get(COMPRESSION).toLowerCase();
View Full Code Here

            logger.debug("get_slice");
        }

        try
        {
            ClientState cState = state();
            String keyspace = cState.getKeyspace();
            state().hasColumnFamilyAccess(keyspace, column_parent.column_family, Permission.SELECT);
            return getSliceInternal(keyspace, key, column_parent, System.currentTimeMillis(), predicate, consistency_level);
        }
        catch (RequestValidationException e)
        {
View Full Code Here

TOP

Related Classes of org.apache.cassandra.service.ClientState

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.