Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalcph committed May 22, 2024
1 parent 6e3f113 commit 7ce211e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,9 @@ public FetchDataInfo read(long startOffset, int maxSize, Optional<Long> maxPosit
if (minOneMessage)
adjustedMaxSize = Math.max(maxSize, startOffsetAndSize.size);

// return a log segment but with zero size in the case below
// return empty records in the fetch-data-info when:
// 1. adjustedMaxSize is 0 (or)
// 2. maxPosition to read is unavailable
if (adjustedMaxSize == 0 || !maxPositionOpt.isPresent())
return new FetchDataInfo(offsetMetadata, MemoryRecords.EMPTY);

Expand Down

0 comments on commit 7ce211e

Please sign in to comment.