/** * Creates a range which represents the intersection of this range and the passed in range. The * following example will print true. * * <pre> * Range range1 = new Range("a", "f"); * Range range2 = new Range("c", "n"); * Range range3 = range1.clip(range2); * System.out.println(range3.equals(new Range("c", "f"))); * </pre> * * @param range * range to clip to * @return the intersection of this range and the given range * @throws IllegalArgumentException * if ranges does not overlap */ public Range clip(Range range) { return clip(range, false); }
@Override public Options overRange(Range range) { this.range = TabletsSection.getRange().clip(range); return this; }
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { range = rowRange.clip(range, true); if (range == null) { hasTop = false; } else { hasTop = true; super.seek(range, columnFamilies, inclusive); } } }
public Scanner createScanner(Range range, int num, Set<Column> columns, Authorizations authorizations, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, boolean isolated, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) { // do a test to see if this range falls within the tablet, if it does not // then clip will throw an exception extent.toDataRange().clip(range); ScanOptions opts = new ScanOptions(num, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, isolated, samplerConfig, batchTimeOut, classLoaderContext); return new Scanner(this, range, opts); }
tabletMap.put(tabletRanges.getKey(), clippedRanges); for (Range range : tabletRanges.getValue()) clippedRanges.add(tabletRange.clip(range));
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { clear(); if (fence != null) { range = fence.clip(range, true); if (range == null) return; } for (SortedKeyValueIterator<Key,Value> skvi : iters) { skvi.seek(range, columnFamilies, inclusive); addSource(skvi); } }
ranges.add(k.toDataRange().clip(range));
private RowRange toClippedExtent(Range r) { r = clipRange.clip(r); Text startRow = removeTrailingZeroFromRow(r.getStartKey()); Text endRow = removeTrailingZeroFromRow(r.getEndKey()); return new RowRange(startRow, endRow); }
tabletRange.clip(range);
clippedRanges.add(ke.clip(r)); org.apache.accumulo.core.clientImpl.mapreduce.BatchInputSplit split = new org.apache.accumulo.core.clientImpl.mapreduce.BatchInputSplit( tableName, tableId, clippedRanges, new String[] {location}); ke.clip(r), new String[] {location}); org.apache.accumulo.core.clientImpl.mapreduce.SplitUtils.updateSplit(split, tableConfig, logLevel);
clippedRanges.add(ke.clip(r)); org.apache.accumulo.core.clientImpl.mapred.BatchInputSplit split = new org.apache.accumulo.core.clientImpl.mapred.BatchInputSplit( tableName, tableId, clippedRanges, new String[] {location}); ke.clip(r), new String[] {location}); org.apache.accumulo.core.clientImpl.mapreduce.SplitUtils.updateSplit(split, tableConfig, logLevel);
RangeSetIter(PeekingIterator1<Range> sourceIter, Range seekRange) { super(sourceIter.source, sourceIter.top); this.seekRange = seekRange; super.top = super.top == null ? null : seekRange.clip(super.top, true); }
Text first = TabletsSection.getRow(tableId, start); Range range = new Range(first, false, null, true); scanner.setRange(range.clip(MetadataSchema.TabletsSection.getRange())); KeyExtent prevExtent = null;
RangeSetIter(Iterator<Range> sourceIter, Range seekRange) { super(sourceIter); this.seekRange = seekRange; super.top = super.top == null ? null : seekRange.clip(super.top, true); }
private void skipRows() throws IOException { SortedKeyValueIterator<Key,Value> source = getSource(); while (source.hasTop()) { Text row = source.getTopKey().getRow(); if (currentRow != null && currentRow.equals(row)) break; Range rowRange = new Range(row); decisionIterator.setRow(rowRange); decisionIterator.seek(rowRange, columnFamilies, inclusive); if (acceptRow(decisionIterator)) { currentRow = row; break; } else { currentRow = null; int count = 0; while (source.hasTop() && count < 10 && source.getTopKey().getRow().equals(row)) { count++; source.next(); } if (source.hasTop() && source.getTopKey().getRow().equals(row)) { Range nextRow = new Range(row, false, null, false); nextRow = range.clip(nextRow, true); if (nextRow == null) hasTop = false; else source.seek(nextRow, columnFamilies, inclusive); } } } }
advRange = advRange.clip(seekRange, true); if (advRange == null) {
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { range = rowRange.clip(range, true); if (range == null) { hasTop = false; } else { hasTop = true; super.seek(range, columnFamilies, inclusive); } } }
public Scanner createScanner(Range range, int num, Set<Column> columns, Authorizations authorizations, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, boolean isolated, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) { // do a test to see if this range falls within the tablet, if it does not // then clip will throw an exception extent.toDataRange().clip(range); ScanOptions opts = new ScanOptions(num, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, isolated, samplerConfig, batchTimeOut, classLoaderContext); return new Scanner(this, range, opts); }
Scanner createScanner(Range range, int num, HashSet<Column> columns, Authorizations authorizations, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, boolean isolated, AtomicBoolean interruptFlag) { // do a test to see if this range falls within the tablet, if it does not // then clip will throw an exception extent.toDataRange().clip(range); ScanOptions opts = new ScanOptions(num, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, isolated); return new Scanner(range, opts); }
private void next(boolean initialSeek) throws IOException { if (!initialSeek) source.next(); while (initialSeek || (!source.hasTop() && rowRangeIterator.hasNext())) { Range targetRange = rowRangeIterator.next(); assert targetRange.clip(seekRange, true) != null; source.seek(targetRange, columnFamilies, inclusive); initialSeek = false; } }