Examples of SliceRange


Examples of org.apache.cassandra.thrift.SliceRange

   
   
    private void doSlice(String keyspace, String key, String columnFamily, byte[] superColumnName)
            throws InvalidRequestException, UnavailableException, TimedOutException, TException, UnsupportedEncodingException, IllegalAccessException, NotFoundException, InstantiationException, ClassNotFoundException
    {
        SliceRange range = new SliceRange(ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, true, 1000000);
        List<ColumnOrSuperColumn> columns = thriftClient_.get_slice(keyspace, key,
            createColumnParent(columnFamily, superColumnName),
            createSlicePredicate(null, range), ConsistencyLevel.ONE);
        int size = columns.size();
       
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

    {
        Token min = StorageService.getPartitioner().getMinimumToken();
        return cfs.getRangeSlice(ArrayUtils.EMPTY_BYTE_ARRAY,
                                 new Bounds(min, min),
                                 10000,
                                 new SliceRange(ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, false, 10000),
                                 null);
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

                new Column(getBytes(5), ByteBufferUtil.bytes("val5"), 1),
                new Column(getBytes(6), ByteBufferUtil.bytes("val6"), 1));
       
        // verify insert.
        final SlicePredicate sp = new SlicePredicate();
        sp.setSlice_range(new SliceRange());
        sp.getSlice_range().setCount(100);
        sp.getSlice_range().setStart(ArrayUtils.EMPTY_BYTE_ARRAY);
        sp.getSlice_range().setFinish(ArrayUtils.EMPTY_BYTE_ARRAY);
       
        assertRowAndColCount(1, 6, scfName, false, cfs.getRangeSlice(scfName, Util.range("f", "g"), 100, QueryFilter.getFilter(sp, cfs.getComparator())));
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

        Table table = Table.open(tableName);
        ColumnFamilyStore cfs = table.getColumnFamilyStore(cfName);
        DecoratedKey key = Util.dk("f-flush-resurrection");
       
        SlicePredicate sp = new SlicePredicate();
        sp.setSlice_range(new SliceRange());
        sp.getSlice_range().setCount(100);
        sp.getSlice_range().setStart(ArrayUtils.EMPTY_BYTE_ARRAY);
        sp.getSlice_range().setFinish(ArrayUtils.EMPTY_BYTE_ARRAY);
       
        // insert
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

    {
        SlicePredicate thriftSlicePredicate = new SlicePredicate();

        if (isColumnRange())
        {
            SliceRange sliceRange = new SliceRange();
            sliceRange.start = getRequestedBound(Bound.START, variables);
            sliceRange.finish = getRequestedBound(Bound.END, variables);
            sliceRange.reversed = isReversed;
            sliceRange.count = -1; // We use this for range slices, where the count is ignored in favor of the global column count
            thriftSlicePredicate.slice_range = sliceRange;
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

        this.cfName = cfName;
    }

    public List<KeySlice> indexGet(ByteBuffer columnName, ByteBuffer value, ByteBuffer startOffset, int limit, boolean isReverse) throws Exception
    {
        SlicePredicate predicate = new SlicePredicate().setSlice_range(new SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER, ByteBufferUtil.EMPTY_BYTE_BUFFER, isReverse, limit));
        ColumnParent parent = new ColumnParent(cfName);
        IndexExpression expression = new IndexExpression(columnName, IndexOperator.EQ, value);
        IndexClause clause = new IndexClause(Arrays.asList(expression), startOffset, limit);
        return client.get_indexed_slices(parent, clause, predicate, cl);
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

        return client.get_indexed_slices(parent, clause, predicate, cl);
    }

    public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiGet(List<ByteBuffer> keys, int limit) throws Exception
    {
        SlicePredicate predicate = new SlicePredicate().setSlice_range(new SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER, ByteBufferUtil.EMPTY_BYTE_BUFFER, false, limit));
        ColumnParent parent = new ColumnParent(cfName);
        return client.multiget_slice(keys, parent, predicate, cl);
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

        return client.multiget_slice(keys, parent, predicate, cl);
    }

    public List<KeySlice> getRangeSlice(ByteBuffer start, ByteBuffer end, int limit) throws Exception
    {
        SlicePredicate predicate = new SlicePredicate().setSlice_range(new SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER, ByteBufferUtil.EMPTY_BYTE_BUFFER, false, limit));
        ColumnParent parent = new ColumnParent(cfName);
        KeyRange range = new KeyRange(limit).setStart_key(start).setEnd_key(end);
        return client.get_range_slices(parent, predicate, range, cl);
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

        return client.get_range_slices(parent, predicate, range, cl);
    }

    public List<ColumnOrSuperColumn> getSlice(ByteBuffer key, ByteBuffer start, ByteBuffer end, int limit, boolean isReverse) throws Exception
    {
        SliceRange sliceRange = new SliceRange().setStart(start).setFinish(end).setReversed(isReverse).setCount(limit);
        // initialize SlicePredicate with existing SliceRange
        SlicePredicate predicate = new SlicePredicate().setSlice_range(sliceRange);
        ColumnParent parent = new ColumnParent(cfName);
        return client.get_slice(key, parent, predicate, cl);
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.SliceRange

        client.batch_mutate(record, cl);
    }

    public List<ColumnOrSuperColumn> get(ByteBuffer keyBuffer, ByteBuffer start, ByteBuffer finish, int order) throws Exception
    {
        SliceRange sliceRange = new SliceRange();
        // start/finish
        sliceRange.setStart(start).setFinish(finish);
        // reversed/count
        sliceRange.setReversed(false).setCount(order);
        // initialize SlicePredicate with existing SliceRange
        SlicePredicate predicate = new SlicePredicate().setSlice_range(sliceRange);
        ColumnParent parent = new ColumnParent(cfName);
        return client.get_slice(keyBuffer, parent, predicate, cl);
    }
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.