boolean finished = false; ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(compactionKVMax).build(); throughputController.start(compactionName); KeyValueScanner kvs = (scanner instanceof KeyValueScanner)? (KeyValueScanner)scanner : null;
contextBuilder.setSizeLimit(sizeScope, maxResultSize, maxResultSize); contextBuilder.setBatchLimit(scanner.getBatch()); contextBuilder.setTimeLimit(timeScope, timeLimit); contextBuilder.setTrackMetrics(trackMetrics); ScannerContext scannerContext = contextBuilder.build(); boolean limitReached = false; while (numOfResults < maxResults) {
contextBuilder.setSizeLimit(sizeScope, maxResultSize); contextBuilder.setBatchLimit(scanner.getBatch()); contextBuilder.setTimeLimit(timeScope, timeLimit); contextBuilder.setTrackMetrics(trackMetrics); ScannerContext scannerContext = contextBuilder.build();
try { boolean more = false; ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(1).build();
boolean hasMore; ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(compactionKVMax).build();
ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(3).build(); while (true) { boolean more = s.next(results, scannerContext);
defaultScannerContext = ScannerContext.newBuilder().setBatchLimit(scan.getBatch()).build();
assertTrue(scanner.next(results, ScannerContext.newBuilder().setBatchLimit(10).build())); assertEquals(2, results.size()); Cell cell = results.get(0); assertFalse(scanner.next(results, ScannerContext.newBuilder().setBatchLimit(10).build())); assertEquals(1, results.size()); cell = results.get(0);
assertTrue(scanner.next(results, ScannerContext.newBuilder().setBatchLimit(10).build())); assertEquals(2, results.size()); Cell cell = results.get(0); assertFalse(scanner.next(results, ScannerContext.newBuilder().setBatchLimit(10).build())); assertEquals(1, results.size()); cell = results.get(0);
assertTrue(scanner.next(results, ScannerContext.newBuilder().setBatchLimit(10).build())); assertEquals(2, results.size()); Cell cell = results.get(0); assertFalse(scanner.next(results, ScannerContext.newBuilder().setBatchLimit(10).build())); assertEquals(1, results.size()); cell = results.get(0);
ScannerContext.newBuilder().setTimeLimit(LimitScope.BETWEEN_CELLS, -1).build())); assertTrue(cells.isEmpty()); scanner.shipped(); ScannerContext.newBuilder().setTimeLimit(LimitScope.BETWEEN_CELLS, -1).build())); Result result = Result.create(cells); assertEquals(VALUE_PREFIX + 999, Bytes.toString(result.getValue(FAMILY, QUAL)));
RegionScanner scanner = region.getScanner(s); List<Cell> results = new ArrayList<>(); ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(2).build(); scanner.next(results, scannerContext); for (Cell keyValue : results) {
/** * Performs memstore flush, writing data from scanner into sink. * @param scanner Scanner to get data from. * @param sink Sink to write data to. Could be StoreFile.Writer. * @param smallestReadPoint Smallest read point used for the flush. */ protected void performFlush(InternalScanner scanner, Compactor.CellSink sink, long smallestReadPoint) throws IOException { int compactionKVMax = conf.getInt(HConstants.COMPACTION_KV_MAX, HConstants.COMPACTION_KV_MAX_DEFAULT); ScannerContext scannerContext = ScannerContext.newBuilder().setBatchLimit(compactionKVMax).build(); List<Cell> kvs = new ArrayList<Cell>(); boolean hasMore; do { hasMore = scanner.next(kvs, scannerContext); if (!kvs.isEmpty()) { for (Cell c : kvs) { // If we know that this KV is going to be included always, then let us // set its memstoreTS to 0. This will help us save space when writing to // disk. sink.append(c); } kvs.clear(); } } while (hasMore); } }
public static Builder newBuilder(boolean keepProgress) { return new Builder(keepProgress); }
public static Builder newBuilder() { return new Builder(); }
@Override public boolean next(List<Cell> cells) throws IOException { return next(cells, ScannerContext.newBuilder().setBatchLimit(batchSize).build()); }
@Override public boolean next(List<Cell> cells) throws IOException { return next(cells, ScannerContext.newBuilder().setBatchLimit(batchSize).build()); }
@Override public boolean nextRaw(List<Cell> cells) throws IOException { return nextRaw(cells, ScannerContext.newBuilder().setBatchLimit(batchSize).build()); }
@Override public boolean next(List<Cell> cells) throws IOException { return next(cells, ScannerContext.newBuilder().setBatchLimit(batchSize).build()); }
@Override public boolean nextRaw(List<Cell> cells) throws IOException { return nextRaw(cells, ScannerContext.newBuilder().setBatchLimit(batchSize).build()); }