Examples of RangeBuilder


Examples of com.netflix.astyanax.util.RangeBuilder

    CreateColumnSliceCallback l = new CreateColumnSliceCallback() {
     
      @Override
      public RowQuery<byte[], byte[]> createRowQuery() {
        RangeBuilder rangeBldr = new RangeBuilder();
        if(from != null)
          rangeBldr.setStart(from);
        if(to != null)
          rangeBldr.setEnd(to);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }

      @Override
      public RowQuery<byte[], byte[]> createRowQueryReverse() {
        RangeBuilder rangeBldr = new RangeBuilder();
        if(to != null)
          rangeBldr.setStart(to);
        if(from != null)
          rangeBldr.setEnd(from);
         
        rangeBldr.setReversed(true);
       
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }
     
     
    };
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

    CreateColumnSliceCallback l = new CreateColumnSliceCallback() {
     
      @Override
      public RowQuery<byte[], byte[]> createRowQuery() {
        RangeBuilder rangeBldr = new RangeBuilder().setStart(from).setEnd(to);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }
    };
     
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

    CreateColumnSliceCallback l = new CreateColumnSliceCallback() {
     
      @Override
      public RowQuery<byte[], byte[]> createRowQuery() {
        RangeBuilder rangeBldr = new RangeBuilder().setStart(from).setEnd(to);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }
    };
     
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

    CreateColumnSliceCallback l = new CreateColumnSliceCallback() {
     
      @Override
      public RowQuery<byte[], byte[]> createRowQuery() {
        RangeBuilder rangeBldr = new RangeBuilder().setStart(from).setEnd(to);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }

      @Override
      public RowQuery<byte[], byte[]> createRowQueryReverse() {
        RangeBuilder rangeBldr = new RangeBuilder().setStart(to).setEnd(from).setReversed(true);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }
     
     
    };
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

    CreateColumnSliceCallback l = new CreateColumnSliceCallback() {
     
      @Override
      public RowQuery<byte[], byte[]> createRowQuery() {
        RangeBuilder rangeBldr = new RangeBuilder().setStart(from).setEnd(to);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }

      @Override
      public RowQuery<byte[], byte[]> createRowQueryReverse() {
        RangeBuilder rangeBldr = new RangeBuilder().setStart(to).setEnd(from).setReversed(true);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }
     
     
    };
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

    CreateColumnSliceCallback l = new CreateColumnSliceCallback() {
     
      @Override
      public RowQuery<byte[], byte[]> createRowQuery() {
        RangeBuilder rangeBldr = new RangeBuilder().setStart(from).setEnd(to);
        if(batchSize != null)
          rangeBldr = rangeBldr.setLimit(batchSize);
        ByteBufferRange range = rangeBldr.build();
        return createBasicRowQuery(rowKey, info1, range);
      }
    };
     
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

        m.execute();

        // Phase 2: Read back all columns. There should be only 1
        ColumnList<String> result = keyspace.prepareQuery(columnFamily).setConsistencyLevel(consistencyLevel)
                .getKey(key)
                .withColumnRange(new RangeBuilder().setStart(prefix + "\u0000").setEnd(prefix + "\uFFFF").build())
                .execute().getResult();

        if (result.size() == 1) {
            return prefix + unique;
        }
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

                        .getRowSlice(ids);
                   
                if (predicates != null && !predicates.isEmpty()) {
                    ByteBuffer[] endpoints = entityMapper.getQueryEndpoints(predicates);
                    rowQuery = rowQuery.withColumnRange(
                            new RangeBuilder()
                                .setStart(endpoints[0])
                                .setEnd(endpoints[1])
                                .setLimit(columnLimit)
                                .build());
                }
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

    public void testColumnRangeSlice() throws ConnectionException {
        OperationResult<ColumnList<String>> r1 = keyspace
                .prepareQuery(CF_STANDARD1)
                .getKey("A")
                .withColumnRange(
                        new RangeBuilder().setStart("a").setEnd("b")
                                .setLimit(5).build()).execute();
        Assert.assertEquals(2, r1.getResult().size());

        OperationResult<ColumnList<String>> r2 = keyspace
                .prepareQuery(CF_STANDARD1).getKey("A")
View Full Code Here

Examples of com.netflix.astyanax.util.RangeBuilder

        Assert.assertEquals(nColumns / 2, count);
       
        // GET ROW COUNT WITH PAGINATION
        RowQuery<String, String> query = keyspace.prepareQuery(CF_STANDARD1)
                .setConsistencyLevel(ConsistencyLevel.CL_QUORUM).getKey(rowKey)
                .withColumnRange(new RangeBuilder().setLimit(pageSize).build())
                .autoPaginate(true);

        ColumnList<String> result;
        count = 0;
        while (!(result = query.execute().getResult()).isEmpty()) {
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.