feyman2016 commented on a change in pull request #8589:
URL: https://github.com/apache/kafka/pull/8589#discussion_r420824271



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
##########
@@ -3621,24 +3641,37 @@ public RemoveMembersFromConsumerGroupResult 
removeMembersFromConsumerGroup(Strin
         KafkaFutureImpl<Map<MemberIdentity, Errors>> future = new 
KafkaFutureImpl<>();
 
         ConsumerGroupOperationContext<Map<MemberIdentity, Errors>, 
RemoveMembersFromConsumerGroupOptions> context =
-            new ConsumerGroupOperationContext<>(groupId, options, deadline, 
future);
+                new ConsumerGroupOperationContext<>(groupId, options, 
deadline, future);
 
-        Call findCoordinatorCall = getFindCoordinatorCall(context,
-            () -> getRemoveMembersFromGroupCall(context));
+        Call findCoordinatorCall;
+        if (options.removeAll()) {
+            List<MemberIdentity> members = getMembersFromGroup(groupId);
+            findCoordinatorCall = getFindCoordinatorCall(context,
+                () -> getRemoveMembersFromGroupCall(context, members));

Review comment:
       My initial thought was to put the `members` in the context, but 
hesitated to do so because the `ConsumerGroupOperationContext` seems to be for 
generic usage. So I just refer to 
`KafkaAdminClient#getAlterConsumerGroupOffsetsCall` and make the members as a 
separate input param. Anyway, I'm glad to make the change if we think it's 
preferred to put the `members` in context.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to