Package org.apache.cassandra.thrift

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


   
    SlicePredicate slicePredicate = new SlicePredicate();
    slicePredicate.setSlice_range(sliceRange);
   
    // Set row range from request
    KeyRange range = new KeyRange(count + 1);
    if (start.length() > 0) {
      range.setStart_key(Hex.decodeHex(start.toCharArray()));
    } else {
      range.setStart_key(new byte[0]);
    }
    if (end.length() > 0) {
      range.setEnd_key(Hex.decodeHex(end.toCharArray()));
    } else {
      range.setEnd_key(new byte[0]);
    }
   
    try {
      // getting slice
      List<KeySlice> slices = client.get_range_slices(
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);
            IPartitioner partitioner = null;
            Range<Token> jobRange = null;
            if (jobKeyRange != null && jobKeyRange.start_token != null)
            {
                partitioner = ConfigHelper.getInputPartitioner(context.getConfiguration());
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

        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)
            {
                if (jobKeyRange.start_key == null)
                {
View Full Code Here

    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

                                state.settings.columns.maxColumnsPerKey
                        )
                );

        final ByteBuffer start = getKey();
        final KeyRange range =
                new KeyRange(state.settings.columns.maxColumnsPerKey)
                        .setStart_key(start)
                        .setEnd_key(ByteBufferUtil.EMPTY_BYTE_BUFFER)
                        .setCount(state.settings.command.keysAtOnce);

        for (final ColumnParent parent : state.columnParents)
        {
            timeWithRetry(new RunOp()
            {
                private int count = 0;
                @Override
                public boolean run() throws Exception
                {
                    return (count = client.get_range_slices(parent, predicate, range, state.settings.command.consistencyLevel).size()) != 0;
                }

                @Override
                public String key()
                {
                    return new String(range.bufferForStart_key().array());
                }

                @Override
                public int keyCount()
                {
View Full Code Here

    ColumnParent clp = new ColumnParent("Standard2");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);

    KeyRange range = new KeyRange();
    range.setStart_key( "".getBytes());
    range.setEnd_key( "".getBytes());

    Map<String, List<Column>> keySlices = se.fromBytesMap(keyspace.getRangeSlices(clp, sp, range));

    assertNotNull(keySlices);
View Full Code Here

    ColumnParent clp = new ColumnParent("Super1");
    SliceRange sr = new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false, 150);
    SlicePredicate sp = new SlicePredicate();
    sp.setSlice_range(sr);

    KeyRange range = new KeyRange();
    range.setStart_key( "".getBytes());
    range.setEnd_key( "".getBytes());


    Map<String, List<SuperColumn>> keySlices = se.fromBytesMap(keyspace.getSuperRangeSlices(clp, sp, range));

    assertNotNull(keySlices);
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)
            {
                if (jobKeyRange.start_key == null)
                {
View Full Code Here

    return row;
  }

  public List<Row> getRangeIntl(String startKey, String endKey, int rowCount, Select select)
  throws IOException {
    KeyRange range = new KeyRange(rowCount).setStart_key(startKey).setEnd_key(endKey);
    return getKeyRange(range, select);
  }
View Full Code Here

TOP

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

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.