rajinisivaram commented on code in PR #10964:
URL: https://github.com/apache/kafka/pull/10964#discussion_r918811781


##########
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java:
##########
@@ -915,23 +916,56 @@ default ListConsumerGroupsResult listConsumerGroups() {
 
     /**
      * List the consumer group offsets available in the cluster.
+     * <p>
+     * @deprecated Since 3.3.
+     * Use {@link #listConsumerGroupOffsets(Map, 
ListConsumerGroupOffsetsOptions)}.
      *
      * @param options The options to use when listing the consumer group 
offsets.
      * @return The ListGroupOffsetsResult
      */
-    ListConsumerGroupOffsetsResult listConsumerGroupOffsets(String groupId, 
ListConsumerGroupOffsetsOptions options);
+    @Deprecated
+    default ListConsumerGroupOffsetsResult listConsumerGroupOffsets(String 
groupId, ListConsumerGroupOffsetsOptions options) {
+        ListConsumerGroupOffsetsOptions listOptions = new 
ListConsumerGroupOffsetsOptions()
+            .requireStable(options.requireStable());
+        return listConsumerGroupOffsets(Collections.singletonMap(groupId, 
options.topicPartitions()), listOptions);
+    }
 
     /**
      * List the consumer group offsets available in the cluster with the 
default options.
      * <p>
-     * This is a convenience method for {@link 
#listConsumerGroupOffsets(String, ListConsumerGroupOffsetsOptions)} with 
default options.
+     * This is a convenience method for {@link #listConsumerGroupOffsets(Map, 
ListConsumerGroupOffsetsOptions)}
+     * to list offsets of all partitions of one group with default options.
      *
      * @return The ListGroupOffsetsResult.
      */
     default ListConsumerGroupOffsetsResult listConsumerGroupOffsets(String 
groupId) {
         return listConsumerGroupOffsets(groupId, new 
ListConsumerGroupOffsetsOptions());
     }
 
+    /**
+     * List the consumer group offsets available in the cluster for the 
specified consumer groups.
+     *
+     * @param groupIdToTopicPartitions Map of consumer group ids to the topic 
partitions of the group to list offsets for.
+     *                                 If value is null, offsets are listed 
for all partitions.
+     * @param options The options to use when listing the consumer group 
offsets.
+     * @return The ListGroupOffsetsResult
+     */
+    ListConsumerGroupOffsetsResult listConsumerGroupOffsets(Map<String, 
List<TopicPartition>> groupIdToTopicPartitions, ListConsumerGroupOffsetsOptions 
options);

Review Comment:
   Yes, totally agree, thanks for the suggestion. Will update the KIP and PR.



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