thetumbled commented on code in PR #4161:
URL: https://github.com/apache/bookkeeper/pull/4161#discussion_r1434027175
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/DefaultEntryLogger.java:
##########
@@ -1036,15 +1036,20 @@ public void scanEntryLog(long entryLogId,
EntryLogScanner scanner) throws IOExce
}
// read the entry
data.clear();
- data.capacity(entrySize);
- int rc = readFromLogChannel(entryLogId, bc, data, pos);
- if (rc != entrySize) {
- LOG.warn("Short read for ledger entry from entryLog {}@{}
({} != {})",
- entryLogId, pos, rc, entrySize);
- return;
+ int capacity = Math.min(scanner.getLengthToRead(), entrySize);
Review Comment:
Good idea, i have refactored the code, please help to review it again,
thanks.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]