@Override protected List<Result> doScan(Scan scan) throws Exception { List<Result> results = getTable.get().scanAll(scan).get(); if (scan.getBatch() > 0) { results = convertFromBatchResult(results); } return results; } }
public Scanner(Scan scan) throws IOException { if (scan.getBatch() > 0) { throw new IOException("Batch is not supported in Scanner"); } if (scan.getCaching() <= 0) { scan.setCaching(scannerCaching); } else if (scan.getCaching() == 1 && scan.isReversed()){ // for reverse scan, we need to pass the last row to the next scanner // we need caching number bigger than 1 scan.setCaching(scan.getCaching() + 1); } this.scan = ThriftUtilities.scanFromHBase(scan); }
@Override protected List<Result> doScan(Scan scan) throws Exception { AsyncTable<?> table = ASYNC_CONN.getTable(TABLE_NAME, ForkJoinPool.commonPool()); List<Result> results = new ArrayList<>(); try (ResultScanner scanner = table.getScanner(scan)) { for (Result result; (result = scanner.next()) != null;) { results.add(result); } } if (scan.getBatch() > 0) { results = convertFromBatchResult(results); } return results; } }
@Override protected List<Result> doScan(Scan scan) throws Exception { BufferingScanResultConsumer scanConsumer = new BufferingScanResultConsumer(); ASYNC_CONN.getTable(TABLE_NAME).scan(scan, scanConsumer); List<Result> results = new ArrayList<>(); for (Result result; (result = scanConsumer.take()) != null;) { results.add(result); } if (scan.getBatch() > 0) { results = convertFromBatchResult(results); } return results; } }
tTimeRange.setMinStamp(in.getTimeRange().getMin()).setMaxStamp(in.getTimeRange().getMax()); out.setTimeRange(tTimeRange); out.setBatchSize(in.getBatch());
includeStopRow = scan.includeStopRow(); maxVersions = scan.getMaxVersions(); batch = scan.getBatch(); storeLimit = scan.getMaxResultsPerColumnFamily(); storeOffset = scan.getRowOffsetPerColumnFamily();
@Override protected List<Result> doScan(Scan scan) throws Exception { AsyncTable<ScanResultConsumer> table = ASYNC_CONN.getTable(TABLE_NAME, ForkJoinPool.commonPool()); SimpleScanResultConsumer consumer = new SimpleScanResultConsumer(); table.scan(scan, consumer); List<Result> results = consumer.getAll(); if (scan.getBatch() > 0) { results = convertFromBatchResult(results); } return results; }
model.setCaching(caching); int batch = scan.getBatch(); if (batch > 0) { model.setBatch(batch);
.setBatchLimit(scan.getBatch()).build(); this.stopRow = scan.getStopRow(); this.includeStopRow = scan.includeStopRow();
assertEquals(scan.getAttributesMap(), scanCopy.getAttributesMap()); assertEquals(scan.getAuthorizations().getLabels(), scanCopy.getAuthorizations().getLabels()); assertEquals(scan.getBatch(), scanCopy.getBatch()); assertEquals(scan.getCacheBlocks(), scanCopy.getCacheBlocks()); assertEquals(scan.getCaching(), scanCopy.getCaching());
.getAttributesMap() + " [scanCache, cacheBlock, scanBatch] : [" + aScan.getCaching() + ", " + aScan.getCacheBlocks() + ", " + aScan .getBatch() + "] and regionLocation : " + regionLocation); .get(0).getAttributesMap() + " [scanCache, cacheBlock, scanBatch] : " + "[" + scans.get(0).getCaching() + ", " + scans.get(0).getCacheBlocks() + ", " + scans.get(0).getBatch() + "] and regionLocation : " + regionLocation);
.getAttributesMap() + " [scanCache, cacheBlock, scanBatch] : [" + aScan.getCaching() + ", " + aScan.getCacheBlocks() + ", " + aScan .getBatch() + "] and regionLocation : " + regionLocation); .get(0).getAttributesMap() + " [scanCache, cacheBlock, scanBatch] : " + "[" + scans.get(0).getCaching() + ", " + scans.get(0).getCacheBlocks() + ", " + scans.get(0).getBatch() + "] and regionLocation : " + regionLocation);
includeStopRow = scan.includeStopRow(); maxVersions = scan.getMaxVersions(); batch = scan.getBatch(); storeLimit = scan.getMaxResultsPerColumnFamily(); storeOffset = scan.getRowOffsetPerColumnFamily();
assertEquals(scan.getAttributesMap(), scanCopy.getAttributesMap()); assertEquals(scan.getAuthorizations().getLabels(), scanCopy.getAuthorizations().getLabels()); assertEquals(scan.getBatch(), scanCopy.getBatch()); assertEquals(scan.getCacheBlocks(), scanCopy.getCacheBlocks()); assertEquals(scan.getCaching(), scanCopy.getCaching());