@Override public void close() { sopConfig.getStatistics().getScan().end(bytes, start); }
@Override public ByteBuffer next() { long startNext = sopConfig.getStatistics().getScan().beginIteration(); if (!hasNext()) { throw new NoSuchElementException(); } foundNext = false; key = scan.getKey(); value = scan.getValue(); int len = key.remaining() + value.remaining(); bytes += len; sopConfig.getStatistics().getScan().endIteration(len, startNext); return key; }
assertEquals(0, stats.getScan().getCount()); assertEquals(0, stats.getScan().getBytes()); assertEquals(0, stats.getScan().getTime()); assertEquals(0, stats.getScan().getIterations()); assertEquals(0, stats.getScan().getIterationTime()); assertEquals(0, stats.getScan().getCount()); int count = 0; for (byte[] bs = null; scanner.hasNext(); ) { count += bs.length + scanner.getValue().length; assertEquals(count, stats.getScan().getBytes()); assertEquals(5, stats.getScan().getIterations()); assertTrue(0 < stats.getScan().getIterationTime()); assertEquals(0, stats.getScan().getCount()); assertEquals(0, stats.getScan().getTime()); assertEquals(1, stats.getScan().getInProgress()); assertEquals(1, stats.getScan().getCount()); assertTrue(0 < stats.getScan().getTime()); assertTrue(stats.getScan().getIterationTime() <= stats.getScan().getTime());
public HFileSortedIterator(HFileScanner scan, SerializedComparator comparator, byte[] from, boolean fromInclusive, byte[] to, boolean toInclusive) throws IOException { this.scan = scan; this.comparator = comparator; this.from = from; this.fromInclusive = fromInclusive; this.to = to; this.toInclusive = toInclusive; assert from == null || to == null || comparator.compare(from, 0, from.length, to, 0, to.length) <= 0; start = sopConfig.getStatistics().getScan().begin(); foundNext = evalFrom(); }
public HFileSortedIterator(HFileScanner scan, byte[] from, boolean fromInclusive, byte[] to, boolean toInclusive) throws IOException { this.scan = scan; this.from = from; this.fromInclusive = fromInclusive; this.to = to; this.toInclusive = toInclusive; scanStat = (stats == null) ? new SortedOplogStatistics("", "").new ScanOperation( 0, 0, 0, 0, 0, 0, 0) : stats.getScan(); scanStart = scanStat.begin(); if (scan == null) { return; } assert from == null || to == null || scan.getReader().getComparator().compare(from, to) <= 0; initIterator(); }
public HFileSortedIterator(HFileScanner scan, byte[] from, boolean fromInclusive, byte[] to, boolean toInclusive) throws IOException { this.scan = scan; this.from = from; this.fromInclusive = fromInclusive; this.to = to; this.toInclusive = toInclusive; scanStat = (stats == null) ? new SortedOplogStatistics("", "").new ScanOperation( 0, 0, 0, 0, 0, 0, 0) : stats.getScan(); scanStart = scanStat.begin(); if (scan == null) { return; } assert from == null || to == null || scan.getReader().getComparator().compare( from, 0, from.length, to, 0, to.length) <= 0; initIterator(); }