mumrah commented on code in PR #19328:
URL: https://github.com/apache/kafka/pull/19328#discussion_r2027246605


##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/ListShareGroupOffsetsHandler.java:
##########
@@ -84,19 +84,23 @@ public DescribeShareGroupOffsetsRequest.Builder 
buildBatchedRequest(int coordina
             DescribeShareGroupOffsetsRequestGroup requestGroup = new 
DescribeShareGroupOffsetsRequestGroup()
                 .setGroupId(groupId);
 
-            Map<String, List<Integer>> topicPartitionMap = new HashMap<>();
-            spec.topicPartitions().forEach(tp -> 
topicPartitionMap.computeIfAbsent(tp.topic(), t -> new 
LinkedList<>()).add(tp.partition()));
-
-            Map<String, DescribeShareGroupOffsetsRequestTopic> requestTopics = 
new HashMap<>();
-            for (TopicPartition tp : spec.topicPartitions()) {
-                requestTopics.computeIfAbsent(tp.topic(), t ->
-                        new DescribeShareGroupOffsetsRequestTopic()
-                            .setTopicName(tp.topic())
-                            .setPartitions(new LinkedList<>()))
-                    .partitions()
-                    .add(tp.partition());
+            if (spec.topicPartitions() != null) {
+                Map<String, List<Integer>> topicPartitionMap = new HashMap<>();
+                spec.topicPartitions().forEach(tp -> 
topicPartitionMap.computeIfAbsent(tp.topic(), t -> new 
LinkedList<>()).add(tp.partition()));

Review Comment:
   I realize it's unrelated to this PR, but why are we using a LinkedList here?



##########
clients/src/main/java/org/apache/kafka/clients/admin/ListShareGroupOffsetsSpec.java:
##########
@@ -47,9 +46,10 @@ public ListShareGroupOffsetsSpec 
topicPartitions(Collection<TopicPartition> topi
 
     /**
      * Returns the topic partitions whose offsets are to be listed for a share 
group.
+     * {@code null} indicates that offsets of all partitions of the group are 
to be listed.
      */
     public Collection<TopicPartition> topicPartitions() {

Review Comment:
   What do we do elsewhere in the admin for "all" vs "none"? 



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