Package org.apache.cassandra.service

Examples of org.apache.cassandra.service.QueryState


    public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException
    {
        return QueryProcessor.process(String.format("SELECT * FROM %s.%s", Auth.AUTH_KS, Auth.USERS_CF),
                                      ConsistencyLevel.ONE,
                                      new QueryState(new ClientState(true)));
    }
View Full Code Here


    public static UntypedResultSet process(String query) throws RequestExecutionException
    {
        try
        {
            QueryState state = new QueryState(new ClientState(true));
            ResultMessage result = process(query, ConsistencyLevel.ONE, state);
            if (result instanceof ResultMessage.Rows)
                return new UntypedResultSet(((ResultMessage.Rows)result).result);
            else
                return null;
View Full Code Here

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

    public static UntypedResultSet process(String query, ConsistencyLevel cl) throws RequestExecutionException
    {
        try
        {
            QueryState state = new QueryState(new ClientState(true));
            ResultMessage result = process(query, cl, state);
            if (result instanceof ResultMessage.Rows)
                return new UntypedResultSet(((ResultMessage.Rows)result).result);
            else
                return null;
View Full Code Here

    public static UntypedResultSet processInternal(String query)
    {
        try
        {
            ClientState state = new ClientState(true);
            QueryState qState = new QueryState(state);
            state.setKeyspace(Table.SYSTEM_KS);
            CQLStatement statement = getStatement(query, state).statement;
            statement.validate(state);
            ResultMessage result = statement.executeInternal(qState);
            if (result instanceof ResultMessage.Rows)
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)
View Full Code Here

        if (!(s.startsWith("create") || s.startsWith("alter") || s.startsWith("drop") || s.startsWith("use") || //
                s.startsWith("select") || s.startsWith("insert") || s.startsWith("delete") || s.startsWith("update")))
            return super.prepareCommand(sql);

        try {
            ResultMessage.Prepared prepared = ClientState.getCQLQueryHandler().prepare(sql, new QueryState(clientState));

            CassandraCommand command = new CassandraCommand(this, sql, prepared, clientState);
            return command;
        } catch (RequestValidationException e) {
            throw DbException.convert(e);
View Full Code Here

    public CassandraCommand(Session session, String sql, ResultMessage.Prepared prepared, ClientState clientState) {
        super(session, sql);
        options = QueryOptions.forInternalCalls(ConsistencyLevel.QUORUM, Collections.<ByteBuffer> emptyList());
        ParsedStatement.Prepared p = ClientState.getCQLQueryHandler().getPrepared(prepared.statementId);
        statement = p.statement;
        queryState = new QueryState(clientState);

        this.prepared = new CassandraPrepared(session);
    }
View Full Code Here

    public static UntypedResultSet process(String query, ConsistencyLevel cl) throws RequestExecutionException
    {
        try
        {
            QueryState state = new QueryState(new ClientState(true));
            ResultMessage result = process(query, cl, state);
            if (result instanceof ResultMessage.Rows)
                return new UntypedResultSet(((ResultMessage.Rows)result).result);
            else
                return null;
View Full Code Here

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

TOP

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

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.