Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.CqlResult


            if (success)
                break;

            try
            {
                CqlResult result = null;

                if (session.usePreparedStatements())
                {
                    Integer stmntId = getPreparedStatement(client, cqlQuery);
                    result = client.execute_prepared_cql_query(stmntId, queryParamsAsByteBuffer(queryParams));
View Full Code Here


            if (success)
                break;

            try
            {
                CqlResult result = null;

                if (session.usePreparedStatements())
                {
                    Integer stmntId = getPreparedStatement(client, cqlQuery);
                    result = client.execute_prepared_cql_query(stmntId,
View Full Code Here

        // Some statements won't have (or don't need) a keyspace (think USE, or CREATE).
        if (statement.type != StatementType.SELECT && StatementType.REQUIRES_KEYSPACE.contains(statement.type))
            keyspace = clientState.getKeyspace();

        CqlResult result = new CqlResult();

        if (!preExecutionHooks.isEmpty())
            for (PreExecutionHook hook : preExecutionHooks)
                statement = hook.processStatement(statement, context);
View Full Code Here

                thriftCols.add(col);
            }
            // The key of CqlRow shoudn't be needed in CQL3
            cqlRows.add(new CqlRow(ByteBufferUtil.EMPTY_BYTE_BUFFER, thriftCols));
        }
        CqlResult res = new CqlResult(CqlResultType.ROWS);
        res.setRows(cqlRows).setSchema(schema);
        return res;
    }
View Full Code Here

        else
        {
            rows = getSlice(variables);
        }

        CqlResult result = new CqlResult();
        result.type = CqlResultType.ROWS;

        // count resultset is a single column named "count"
        if (parameters.isCount)
        {
View Full Code Here

        {
            long start = System.currentTimeMillis();

            boolean success = false;
            String exceptionMessage = null;
            CqlResult results = null;

            for (int t = 0; t < session.getRetryTimes(); t++)
            {
                if (success)
                    break;
View Full Code Here

            if (success)
                break;

            try
            {
                CqlResult result = client.execute_cql_query(ByteBuffer.wrap(query.toString().getBytes()),
                                                            Compression.NONE);
                success = (result.rows.get(0).columns.size() != 0);
            }
            catch (Exception e)
            {
View Full Code Here

            if (success)
                break;

            try
            {
                CqlResult result = client.execute_cql_query(ByteBuffer.wrap(query.toString().getBytes()),
                                                            Compression.NONE);
                assert result.type.equals(CqlResultType.ROWS) : "expected ROWS result type";
                assert result.rows.size() == 0 : "expected exactly one row";
                success = (result.rows.get(0).columns.size() != 0);
            }
View Full Code Here

            if (success)
                break;

            try
            {
                CqlResult result = client.execute_cql_query(ByteBuffer.wrap(query.toString().getBytes()),
                                                            Compression.NONE);
                rowCount = result.rows.size();
                success = (rowCount != 0);
            }
            catch (Exception e)
View Full Code Here

        String cqlQuery = "SELECT token_bytes,requested_at FROM system.range_xfers";
        Map<String, List<CqlRow>> results = new HashMap<String, List<CqlRow>>();

        for (String host : getLiveNodes())
        {
            CqlResult result = executeCqlQuery(host, thriftPort, thriftFramed, cqlQuery);
            results.put(host, result.getRows());
        }

        return results;
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.CqlResult

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.