Examples of SliceByNamesReadCommand


Examples of org.apache.cassandra.db.SliceByNamesReadCommand

 

    public List<column_t> get_slice_by_names(String tablename, String key, String columnParent, List<String> columnNames) throws InvalidRequestException
    {
        logger.debug("get_slice_by_names");
        ColumnFamily cfamily = readColumnFamily(new SliceByNamesReadCommand(tablename, key, columnParent, columnNames));
        if (cfamily == null)
        {
            return EMPTY_COLUMNS;
        }
        return thriftifyColumns(cfamily.getAllColumns());
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

  }

    public List<superColumn_t> get_slice_super_by_names(String tablename, String key, String columnFamily, List<String> superColumnNames) throws InvalidRequestException
    {
        logger.debug("get_slice_super_by_names");
        ColumnFamily cfamily = readColumnFamily(new SliceByNamesReadCommand(tablename, key, columnFamily, superColumnNames));
        if (cfamily == null)
        {
            return EMPTY_SUPERCOLUMNS;
        }
        return thriftifySuperColumns(cfamily.getAllColumns());
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

            QueryProcessor.validateColumnNames(columnNames);

            for (ByteBuffer key: getKeys(variables))
            {
                QueryProcessor.validateKey(key);
                commands.add(new SliceByNamesReadCommand(keyspace(), key, queryPath, columnNames));
            }
        }

        try
        {
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

            QueryProcessor.validateColumnNames(columnNames);

            for (ByteBuffer key: getKeys(variables))
            {
                QueryProcessor.validateKey(key);
                commands.add(new SliceByNamesReadCommand(keyspace(), key, queryPath, columnNames));
            }
        }

        try
        {
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

        if (predicate.column_names != null)
        {
            for (ByteBuffer key: keys)
            {
                ThriftValidation.validateKey(key);
                commands.add(new SliceByNamesReadCommand(keyspace, key, column_parent, predicate.column_names));
            }
        }
        else
        {
            SliceRange range = predicate.slice_range;
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

        ThriftValidation.validateColumnPath(keyspace, column_path);

        QueryPath path = new QueryPath(column_path.column_family, column_path.column == null ? null : column_path.super_column);
        List<ByteBuffer> nameAsList = Arrays.asList(column_path.column == null ? column_path.super_column : column_path.column);
        ThriftValidation.validateKey(key);
        ReadCommand command = new SliceByNamesReadCommand(keyspace, key, path, nameAsList);

        Map<DecoratedKey, ColumnFamily> cfamilies = readColumnFamily(Arrays.asList(command), consistency_level);

        ColumnFamily cf = cfamilies.get(StorageService.getPartitioner().decorateKey(command.key));
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

     * @return the current job tracker IP
     * @throws TrackerManagerException
     */
    public static InetAddress getCurrentJobtrackerLocation() throws TrackerManagerException {

        ReadCommand rc = new SliceByNamesReadCommand(BriskSchema.KEYSPACE_NAME, currentJobtrackerKey, cp, Arrays.asList(columnName));

        String result;
        try {
            List<Row> rows = StorageProxy.read(Arrays.asList(rc), ConsistencyLevel.QUORUM);
            IColumn col = validateAndGetColumn(rows, columnName);
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

           throw new RuntimeException(e1);
        }

        ByteBuffer key = CassandraUtils.hashKeyBytes(indexNameBytes, CassandraUtils.delimeterBytes, docId);

        ReadCommand rc = new SliceByNamesReadCommand(CassandraUtils.keySpace, key, CassandraUtils.metaColumnPath,
                Arrays.asList(CassandraUtils.documentMetaFieldBytes));


        List<Row> rows = null;
        try
        {

            rows = CassandraUtils.robustRead(CassandraUtils.consistency, rc);


            if (rows.isEmpty())
            {

                return; // this docId is missing
            }

          

            DocumentMetadata allTerms = IndexWriter.fromBytesUsingThrift(rows.get(0).cf.getColumn(
                    CassandraUtils.documentMetaFieldBytes).value());

            List<ReadCommand> readCommands = new ArrayList<ReadCommand>();

            for (ThriftTerm t : allTerms.getTerms())
            {
                // skip the ones not of this field
                if (!t.getField().equals(field))
                    continue;

                // add to multiget params
                try
                {
                    key = CassandraUtils.hashKeyBytes(indexName.getBytes("UTF-8"), CassandraUtils.delimeterBytes, t.getField()
                            .getBytes("UTF-8"), CassandraUtils.delimeterBytes, t.getText());
                }
                catch (UnsupportedEncodingException e)
                {
                    throw new RuntimeException("JVM doesn't support UTF-8", e);
                }

                readCommands.add(new SliceByNamesReadCommand(CassandraUtils.keySpace, key, new ColumnParent()
                        .setColumn_family(CassandraUtils.termVecColumnFamily), Arrays.asList(ByteBuffer
                        .wrap(CassandraUtils.writeVInt(docI)))));
            }

            rows = CassandraUtils.robustRead(CassandraUtils.consistency, readCommands.toArray(new ReadCommand[] {}));
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

        catch (UnsupportedEncodingException e2)
        {
            throw new RuntimeException("JVM doesn't support UTF-8", e2);
        }

        ReadCommand rc = new SliceByNamesReadCommand(CassandraUtils.keySpace, key, parent, docNums);

        List<Row> rows = CassandraUtils.robustRead(CassandraUtils.consistency, rc);

        LucandraTermInfo[] termInfo = null;
View Full Code Here

Examples of org.apache.cassandra.db.SliceByNamesReadCommand

        if (predicate.column_names != null)
        {
            for (ByteBuffer key: keys)
            {
                ThriftValidation.validateKey(key);
                commands.add(new SliceByNamesReadCommand(keyspace, key, column_parent, predicate.column_names));
            }
        }
        else
        {
            SliceRange range = predicate.slice_range;
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.