Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Range


                log.warn("No start/end keys specified for MultiRangeScan");
            return ranges;
        }

        for(Map.Entry<String, String> pair : startEndPairs.entrySet()) {
            Range range = new Range(pair.getKey(), pair.getValue());
            ranges.add(range);
        }
        return ranges;
    }
View Full Code Here


        } catch (NoSuchElementException e){
            endKey = null;
        }
        if(log.isInfoEnabled())
            log.info("SingleRangeScan using start key: " + startKey + " end key: " + endKey);
        scan.setRange(new Range(startKey, endKey));
        return scan;
    }
View Full Code Here

            scanner.addScanIterator(is);
          }
        }
        org.apache.accumulo.proxy.thrift.Range prange = opts.range;
        if (prange != null) {
          Range range = new Range(Util.fromThrift(prange.getStart()), prange.startInclusive, Util.fromThrift(prange.getStop()), prange.stopInclusive);
          scanner.setRange(range);
        }
        if (opts.columns != null) {
          for (ScanColumn col : opts.columns) {
            if (col.isSetColQualifier())
View Full Code Here

        }
       
        ArrayList<Range> ranges = new ArrayList<Range>();
       
        if (opts.ranges == null) {
          ranges.add(new Range());
        } else {
          for (org.apache.accumulo.proxy.thrift.Range range : opts.ranges) {
            Range aRange = new Range(range.getStart() == null ? null : Util.fromThrift(range.getStart()), true, range.getStop() == null ? null
                : Util.fromThrift(range.getStop()), false);
            ranges.add(aRange);
          }
        }
        scanner.setRanges(ranges);
View Full Code Here

    result.setTimestamp(k.getTimestamp());
    return result;
  }
 
  private Range getRange(org.apache.accumulo.proxy.thrift.Range range) {
    return new Range(Util.fromThrift(range.start), Util.fromThrift(range.stop));
  }
View Full Code Here

    }
  }
 
  @Override
  public org.apache.accumulo.proxy.thrift.Range getRowRange(ByteBuffer row) throws TException {
    return getRange(new Range(ByteBufferUtil.toText(row)));
  }
View Full Code Here

  @Override
  public T get(K key, String[] fields) {
    try {
      // TODO make isolated scanner optional?
      Scanner scanner = new IsolatedScanner(conn.createScanner(mapping.tableName, Constants.NO_AUTHS));
      Range rowRange = new Range(new Text(toBytes(key)));
     
      scanner.setRange(rowRange);
      setFetchColumns(scanner, fields);
     
      T persistent = newPersistent();
View Full Code Here

      startRow = new Text(toBytes(query.getStartKey()));
   
    if (query.getEndKey() != null)
      endRow = new Text(toBytes(query.getEndKey()));
   
    return new Range(startRow, true, endRow, true);
   
  }
View Full Code Here

   
    SortedMapIterator source = new SortedMapIterator(tm);
   
    SortedKeyValueIterator<Key,Value> iter = IteratorUtil.loadIterators(IteratorScope.minc, source, new KeyExtent(new Text("tab"), null, null), conf,
        new DefaultIteratorEnvironment(conf));
    iter.seek(new Range(), EMPTY_COL_FAMS, false);
   
    assertTrue(iter.hasTop());
    assertTrue(iter.getTopKey().equals(MultiIteratorTest.nk(1, 0)));
    assertTrue(iter.getTopValue().toString().equals("4"));
   
View Full Code Here

   
    SortedMapIterator source = new SortedMapIterator(tm);
   
    SortedKeyValueIterator<Key,Value> iter = IteratorUtil.loadIterators(IteratorScope.majc, source, new KeyExtent(new Text("tab"), null, null), conf,
        new DefaultIteratorEnvironment(conf));
    iter.seek(new Range(), EMPTY_COL_FAMS, false);
   
    assertTrue(iter.hasTop());
    assertTrue(iter.getTopKey().equals(MultiIteratorTest.nk(1, 0)));
    assertTrue(iter.getTopValue().toString().equals("1"));
   
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.data.Range

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.