chia7712 commented on code in PR #19214: URL: https://github.com/apache/kafka/pull/19214#discussion_r2003894741
########## clients/src/main/java/org/apache/kafka/common/record/FileRecords.java: ########## @@ -297,12 +297,33 @@ public int writeTo(TransferableChannel destChannel, int offset, int length) thro * @param startingPosition The starting position in the file to begin searching from. * @return the batch's base offset, its physical position, and its size (including log overhead) */ - public LogOffsetPosition searchForOffsetWithSize(long targetOffset, int startingPosition) { + public LogOffsetPosition searchForOffsetFromPosition(long targetOffset, int startingPosition) { Review Comment: Please add comments to highlight the following complex logic is to save memory by avoiding using `lastOffset`. Otherwise, there may be a developer who want to streamline the code by using `lastOffset`. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org