public InnerScannerAsIterator(RegionScanner regionScanner) { this.regionScanner = regionScanner; try { hasMore = regionScanner.nextRaw(nextOne); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public boolean nextRaw(List<Cell> result) throws IOException { return delegate.nextRaw(result); }
@Override public boolean nextRaw(List<Cell> result, ScannerContext context) throws IOException { return delegate.nextRaw(result, context); }
@Override public List<Cell> next() { if (nextOne.size() < 1) { throw new IllegalStateException(); } ret.clear(); ret.addAll(nextOne); nextOne.clear(); try { if (hasMore) { hasMore = regionScanner.nextRaw(nextOne); } } catch (IOException e) { throw new RuntimeException(e); } return ret; } }
@Override public boolean nextRaw(List<Cell> result) throws IOException { return delegate.nextRaw(result); }
@Override public Result next() throws IOException { values.clear(); scanner.nextRaw(values); if (values.isEmpty()) { //we are done return null; } Result result = Result.create(values); if (this.scanMetrics != null) { long resultSize = 0; for (Cell cell : values) { resultSize += PrivateCellUtil.estimatedSerializedSizeOf(cell); } this.scanMetrics.countOfBytesInResults.addAndGet(resultSize); this.scanMetrics.countOfRowsScanned.incrementAndGet(); } return result; }
@Override public boolean nextRaw(List<Cell> result, ScannerContext context) throws IOException { boolean nextRaw = delegate.nextRaw(result, context); if (compactionLatch != null && compactionLatch.getCount() > 0) { try { compactionLatch.await(); } catch (InterruptedException ie) { } } if (CustomInnerRegionObserver.throwException.get()) { if (exceptionLatch.getCount() > 0) { try { exceptionLatch.await(); } catch (InterruptedException e) { } throw new IOException("throw exception"); } } return nextRaw; }
@Override public boolean nextRaw(List<Cell> result, int limit) throws IOException { return outerScanner.nextRaw(result, limit); }
@Override public boolean nextRaw(List<Cell> result) throws IOException { return outerScanner.nextRaw(result); }
@Override public boolean nextRaw(List<Cell> arg0) throws IOException { return delegate.nextRaw(arg0); }
do { tmpCells = new ArrayList<>(); scanner.nextRaw(tmpCells); regionCells.addAll(tmpCells); } while (!tmpCells.isEmpty());
hasMore = false; } else { hasMore = scanner.nextRaw(cells); if (cells.isEmpty()) { continue;
int counter = 0; for (RegionScanner innerScanner : regionScanners) { while (innerScanner.nextRaw(temp)) { counter++;
moreRows = scanner.nextRaw(values, scannerContext);
@Override public Result next() throws IOException { values.clear(); scanner.nextRaw(values); statisticsCollector.collectStatistics(values); if (values.isEmpty()) { //we are done return null; } return Result.create(values); }
@Override public boolean nextRaw(List<KeyValue> result, String metric) throws IOException { while (shouldAdvance()) { hasMore = scanner.nextRaw(result, metric); processResults(result, false); result.clear(); } return nextInQueue(result); }
@Override public boolean nextRaw(List<KeyValue> result, int limit, String metric) throws IOException { while (shouldAdvance()) { hasMore = scanner.nextRaw(result, limit, metric); processResults(result, true); result.clear(); } return nextInQueue(result); }
@Override public boolean nextRaw(List<KeyValue> result, String metric) throws IOException { try { return s.nextRaw(result, metric); } catch (Throwable t) { ServerUtil.throwIOException(c.getEnvironment().getRegion().getRegionNameAsString(), t); return false; // impossible } }
@Override public boolean nextRaw(List<KeyValue> result, int limit, String metric) throws IOException { try { return s.nextRaw(result, limit, metric); } catch (Throwable t) { ServerUtil.throwIOException(c.getEnvironment().getRegion().getRegionNameAsString(), t); return false; // impossible } } };
@Override public boolean nextRaw(List<Cell> result) throws IOException { try { while (shouldAdvance()) { hasMore = scanner.nextRaw(result); processResults(result, false); result.clear(); } return nextInQueue(result); } catch (Throwable t) { ServerUtil.throwIOException(env.getRegion().getRegionInfo().getRegionNameAsString(), t); return false; // impossible } }