dao-jun commented on code in PR #4259:
URL: https://github.com/apache/bookkeeper/pull/4259#discussion_r1573265982
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java:
##########
@@ -170,25 +169,21 @@ protected ReadResponse readEntry(ReadResponse.Builder
readResponseBuilder,
boolean readLACPiggyBack,
Stopwatch startTimeSw)
throws IOException, BookieException {
- ByteBuf entryBody = requestProcessor.getBookie().readEntry(ledgerId,
entryId);
+ entryBody = requestProcessor.getBookie().readEntry(ledgerId, entryId);
if (null != fenceResult) {
- handleReadResultForFenceRead(entryBody, readResponseBuilder,
entryId, startTimeSw);
+ handleReadResultForFenceRead(readResponseBuilder, entryId,
startTimeSw);
return null;
} else {
- try {
-
readResponseBuilder.setBody(ByteString.copyFrom(entryBody.nioBuffer()));
- if (readLACPiggyBack) {
- readResponseBuilder.setEntryId(entryId);
- } else {
- long knownLAC =
requestProcessor.getBookie().readLastAddConfirmed(ledgerId);
- readResponseBuilder.setMaxLAC(knownLAC);
- }
- registerSuccessfulEvent(readStats, startTimeSw);
- readResponseBuilder.setStatus(StatusCode.EOK);
- return readResponseBuilder.build();
- } finally {
- ReferenceCountUtil.release(entryBody);
+
readResponseBuilder.setBody(UnsafeByteOperations.unsafeWrap(entryBody.nioBuffer()));
Review Comment:
@lhotari Thanks for reminding, fixed
--
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]