ShivsundarR commented on code in PR #20752:
URL: https://github.com/apache/kafka/pull/20752#discussion_r2459723779
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareCompletedFetch.java:
##########
@@ -99,10 +99,21 @@ public class ShareCompletedFetch {
}
private List<OffsetAndDeliveryCount>
buildAcquiredRecordList(List<ShareFetchResponseData.AcquiredRecords>
partitionAcquiredRecords) {
- List<OffsetAndDeliveryCount> acquiredRecordList = new LinkedList<>();
+ // Setting the size of the array to the size of the first batch of
acquired records. In case there is only 1 batch acquired, resizing would not
happen.
+ int initialListSize = !partitionAcquiredRecords.isEmpty() ? (int)
(partitionAcquiredRecords.get(0).lastOffset() -
Review Comment:
Yes makes sense, I have updated the code now.
--
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]