You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/13 19:20:02 UTC

[GitHub] [kafka] dajac commented on a change in pull request #11022: KAFKA-13063: refactor DescribeConsumerGroupsHandler and tests

dajac commented on a change in pull request #11022:
URL: https://github.com/apache/kafka/pull/11022#discussion_r668853531



##########
File path: clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeConsumerGroupsHandler.java
##########
@@ -151,38 +162,59 @@ public String apiName() {
                 completed.put(groupIdKey, consumerGroupDescription);
             } else {
                 failed.put(groupIdKey, new IllegalArgumentException(
-                        String.format("GroupId %s is not a consumer group (%s).",
-                                groupIdKey.idValue, protocolType)));
+                    String.format("GroupId %s is not a consumer group (%s).",
+                        groupIdKey.idValue, protocolType)));
             }
         }
-        return new ApiResult<>(completed, failed, unmapped);
+
+        if (groupsToUnmap.isEmpty() && groupsToRetry.isEmpty()) {

Review comment:
       It seems incorrect here as well.

##########
File path: clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeConsumerGroupsHandler.java
##########
@@ -103,6 +104,12 @@ public String apiName() {
         return new DescribeGroupsRequest.Builder(data);
     }
 
+    private void validateGroupsNotEmpty(List<DescribedGroup> describedGroups) {
+        if (describedGroups.isEmpty()) {
+            throw new InvalidGroupIdException("No consumer group found");
+        }
+    }

Review comment:
       What's the purpose of this check? I am not sure where this `InvalidGroupIdException` thrown here will get to.




-- 
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: jira-unsubscribe@kafka.apache.org

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