hangc0276 commented on code in PR #3192: URL: https://github.com/apache/bookkeeper/pull/3192#discussion_r846881714
########## bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java: ########## @@ -1014,10 +1041,18 @@ public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOExce if (pos >= bc.size()) { break; } - if (readFromLogChannel(entryLogId, bc, headerBuffer, pos) != headerBuffer.capacity()) { + + Pair<Integer, Integer> readBytesPair = + readFromLogChannelWithPrefetchBytes(entryLogId, bc, headerBuffer, pos); + if (readBytesPair.getLeft() != headerBuffer.capacity()) { LOG.warn("Short read for entry size from entrylog {}", entryLogId); return; } + + if (throttler != null) { + throttler.acquire(readBytesPair.getRight()); Review Comment: The release operation controlled by `RateLimiter` library in guava -- 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...@bookkeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org