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


##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/ListShareGroupOffsetsHandler.java:
##########
@@ -86,9 +86,6 @@ public DescribeShareGroupOffsetsRequest.Builder 
buildBatchedRequest(int coordina
                 .setGroupId(groupId);
 
             if (spec.topicPartitions() != null) {
-                Map<String, List<Integer>> topicPartitionMap = new HashMap<>();
-                spec.topicPartitions().forEach(tp -> 
topicPartitionMap.computeIfAbsent(tp.topic(), t -> new 
ArrayList<>()).add(tp.partition()));
-
                 Map<String, DescribeShareGroupOffsetsRequestTopic> 
requestTopics = new HashMap<>();

Review Comment:
   I think DescribeShareGroupOffsetsRequest could leverage mapKey to avoid 
creating an extra collection here. I opened 
https://issues.apache.org/jira/browse/KAFKA-21454 and will file a patch soon.



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