chia7712 commented on PR #14359:
URL: https://github.com/apache/kafka/pull/14359#issuecomment-3372367774

   ```
           // Return all partitions that are in an otherwise fetchable state 
*and* for which we don't already have some
           // messages sitting in our buffer.
           return new 
HashSet<>(subscriptions.fetchablePartitions(isNotBuffered));
   ```
   
   Out of curiosity, why are they being copied into a new `Set` collection? The 
`ShareConsumeRequestManager` directly use the `List` type without an extra deep 
copy. Also, the elements returned by `subscriptions.fetchablePartitions` should 
already be deduplicated.
   
   
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java#L1076


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