Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.KeyRange$KeyRangeStandardSchemeFactory


         String startKey = "";

         // Get the keys in SLICE_SIZE blocks
         int sliceSize = Math.min(SLICE_SIZE, numEntries);
         for (boolean complete = false; !complete;) {
            KeyRange keyRange = new KeyRange(sliceSize);
            keyRange.setStart_token(startKey);
            keyRange.setEnd_token("");
            List<KeySlice> keySlices = cassandraClient.get_range_slices(entryColumnParent,
                     slicePredicate, keyRange, readConsistencyLevel);

            // Cycle through all the keys
            for (KeySlice keySlice : keySlices) {
View Full Code Here


                  ByteBufferUtil.EMPTY_BYTE_BUFFER, false, 1));
         String startKey = "";
         boolean complete = false;
         // Get the keys in SLICE_SIZE blocks
         while (!complete) {
            KeyRange keyRange = new KeyRange(SLICE_SIZE);
            keyRange.setStart_token(startKey);
            keyRange.setEnd_token("");
            List<KeySlice> keySlices = cassandraClient.get_range_slices(entryColumnParent,
                     slicePredicate, keyRange, readConsistencyLevel);
            if (keySlices.size() < SLICE_SIZE) {
               complete = true;
            } else {
View Full Code Here

                  ByteBufferUtil.EMPTY_BYTE_BUFFER, false, 1));
         String startKey = "";
         boolean complete = false;
         // Get the keys in SLICE_SIZE blocks
         while (!complete) {
            KeyRange keyRange = new KeyRange(SLICE_SIZE);
            keyRange.setStart_token(startKey);
            keyRange.setEnd_token("");
            List<KeySlice> keySlices = cassandraClient.get_range_slices(entryColumnParent,
                     slicePredicate, keyRange, readConsistencyLevel);
            if (keySlices.size() < SLICE_SIZE) {
               complete = true;
            } else {
View Full Code Here

        List<InputSplit> splits = new ArrayList<InputSplit>();

        try
        {
            List<Future<List<InputSplit>>> splitfutures = new ArrayList<Future<List<InputSplit>>>();
            KeyRange jobKeyRange = ConfigHelper.getInputKeyRange(conf);
            Range<Token> jobRange = null;
            if (jobKeyRange != null && jobKeyRange.start_token != null)
            {
                assert partitioner.preservesOrder() : "ConfigHelper.setInputKeyRange(..) can only be used with a order preserving paritioner";
                assert jobKeyRange.start_key == null : "only start_token supported";
View Full Code Here

            {
                rows = null;
                return;
            }
           
            KeyRange keyRange = new KeyRange(batchRowCount)
                                .setStart_token(startToken)
                                .setEnd_token(split.getEndToken());
            try
            {
                rows = client.get_range_slices(new ColumnParent(cfName),
View Full Code Here

      }
        SlicePredicate predicate = new SlicePredicate();
        SliceRange range = new SliceRange(ByteBufferUtil.bytes(""), ByteBufferUtil.bytes(""), false, MAX_COLUMNS);
        predicate.setSlice_range(range);

        KeyRange keyRange = new KeyRange(MAX_ROWS);
        keyRange.setStart_key(ByteBufferUtil.bytes(""));
        keyRange.setEnd_key(ByteBufferUtil.EMPTY_BYTE_BUFFER);
        ColumnParent parent = new ColumnParent(columnFamily);
        List<KeySlice> rows = getConnection(keyspace).get_range_slices(parent, predicate, keyRange, consistencyLevel);
        return JsonMarshaller.marshallRows(rows, true);
    }
View Full Code Here

    private List<KeySlice> getKeySlice(ByteBuffer startKey,
                                       ByteBuffer endKey,
                                       SliceQuery columnSlice,
                                       int count) throws StorageException {
        return getRangeSlices(new KeyRange().setStart_key(startKey).setEnd_key(endKey).setCount(count), columnSlice);
    }
View Full Code Here

            SliceQuery sliceQuery, int count) throws StorageException {
       
        String st = sanitizeBrokenByteToken(startToken);
        String et = sanitizeBrokenByteToken(endToken);
       
        KeyRange kr = new KeyRange().setStart_token(st).setEnd_token(et).setCount(count);

        return getRangeSlices(kr, sliceQuery);
    }
View Full Code Here

        if (columns != null && !columns.isEmpty())
        {
            slicePredicate = Selector.newColumnsPredicate(columns.toArray(new String[] {}));
        }

        KeyRange keyRange = selector.newKeyRange(minVal != null ? Bytes.fromByteArray(minVal) : Bytes.fromUTF8(""),
                maxVal != null ? Bytes.fromByteArray(maxVal) : Bytes.fromUTF8(""), maxResults);
        if (conditions != null)
        {
            keyRange.setRow_filter(conditions);
            keyRange.setRow_filterIsSet(true);
        }
        List<KeySlice> keys = selector.getKeySlices(new ColumnParent(m.getTableName()), keyRange, slicePredicate,
                getConsistencyLevel());

        List results = null;
View Full Code Here

                }

                predicate = new SlicePredicate().setColumn_names(fieldlist);
            }

            KeyRange kr = new KeyRange().setStart_key(startkey.getBytes("UTF-8")).setEnd_key(new byte[] {})
                    .setCount(recordcount);

            List<KeySlice> results = client.get_range_slices(parent, predicate, kr, scanConsistencyLevel);

            if (_debug)
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.KeyRange$KeyRangeStandardSchemeFactory

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.