long runningSum = 0; int addedCnt = 0; baseScanner.startNext(); Cell cell; while ((cell = baseScanner.peekNextCell(limit)) != null && (limit <= 0 || addedCnt < limit)) { baseScanner.nextCell(limit); continue; baseScanner.nextCell(limit); baseScanner.nextCell(limit); boolean hasMore = baseScanner.hasMore(); if (LOG.isTraceEnabled()) { LOG.trace("nextInternal done with limit=" + limit + " hasMore=" + hasMore);
/** * Returns the next available cell for the current row and advances the pointer to the next cell. This method * can be called multiple times in a row to advance through all the available cells. * * @param limit the limit of number of cells to return if the next batch must be fetched by the wrapped scanner * @return the next available cell or null if no more cells are available for the current row * @throws IOException */ public Cell nextCell(int limit) throws IOException { Cell cell = peekNextCell(limit); if (cell != null) { currentIdx++; } return cell; }
@Override public void close() throws IOException { baseScanner.close(); }
IncrementSummingScanner(HRegion region, int batchSize, InternalScanner internalScanner, ScanType scanType, long compationUpperBound, long oldestTsByTTL) { this.region = region; this.batchSize = batchSize; this.baseScanner = new WrappedScanner(internalScanner); if (internalScanner instanceof RegionScanner) { this.baseRegionScanner = (RegionScanner) internalScanner; } this.scanType = scanType; this.compactionUpperBound = compationUpperBound; this.oldestTsByTTL = oldestTsByTTL; }