Apache9 commented on code in PR #4967: URL: https://github.com/apache/hbase/pull/4967#discussion_r1089669343
########## hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java: ########## @@ -3616,8 +3620,9 @@ public ScanResponse scan(final RpcController controller, final ScanRequest reque if (region.getCoprocessorHost() != null) { Boolean bypass = region.getCoprocessorHost().preScannerNext(scanner, results, rows); if (!results.isEmpty()) { + Object lastBlock = null; for (Result r : results) { - lastBlock.setValue(addSize(rpcCall, r, lastBlock.getValue())); + lastBlock = addSize(rpcCall, r, lastBlock); Review Comment: I'm still a bit confused, if we do not pass lastBlock done, how could we count the size of these blocks and limit the total size? ########## hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileScanner.java: ########## @@ -140,4 +141,11 @@ public interface HFileScanner extends Shipper, Closeable { */ @Override void close(); + + /** + * Record the size of the current block in bytes, passing as an argument to the blockSizeConsumer. + * Implementations should ensure that blockSizeConsumer is only called once per block. + * @param blockSizeConsumer to be called with block size in bytes, once per block. + */ + void recordBlockSize(Consumer<Integer> blockSizeConsumer); Review Comment: Just use IntConsumer? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org