chia7712 commented on code in PR #22200:
URL: https://github.com/apache/kafka/pull/22200#discussion_r3178915524


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/Cleaner.java:
##########
@@ -253,7 +253,9 @@ public void cleanSegments(UnifiedLog log,
                 // Note that it is important to collect aborted transactions 
from the full log segment
                 // range since we need to rebuild the full transaction index 
for the new segment.
                 long startOffset = currentSegment.baseOffset();
-                long upperBoundOffset = 
nextSegmentOpt.map(LogSegment::baseOffset).orElse(currentSegment.readNextOffset());
+                long upperBoundOffset = nextSegmentOpt.isPresent()

Review Comment:
   Would you mind adding a comment for this change? Otherwise, someone might 
unintentionally remove the lazy evaluation in the future.



-- 
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]

Reply via email to