rreddy-22 commented on code in PR #15152: URL: https://github.com/apache/kafka/pull/15152#discussion_r1448098432
########## core/src/main/scala/kafka/coordinator/group/GroupCoordinator.scala: ########## @@ -1105,16 +1105,18 @@ private[group] class GroupCoordinator( } } - def handleListGroups(states: Set[String]): (Errors, List[GroupOverview]) = { + def handleListGroups(states: Set[String], groupTypes: Set[String]): (Errors, List[GroupOverview]) = { if (!isActive.get) { (Errors.COORDINATOR_NOT_AVAILABLE, List[GroupOverview]()) } else { val errorCode = if (groupManager.isLoading) Errors.COORDINATOR_LOAD_IN_PROGRESS else Errors.NONE - // if states is empty, return all groups - val groups = if (states.isEmpty) - groupManager.currentGroups - else - groupManager.currentGroups.filter(g => states.contains(g.summary.state)) + // Filter groups based on states and groupTypes. If either is empty, it won't filter on that criterion. + // If groupType is mentioned then no group is returned since the notion of groupTypes doesn't exist in the + // old group coordinator. + val groups = groupManager.currentGroups.filter { g => + (states.isEmpty || states.contains(g.summary.state)) && + (groupTypes.isEmpty || groupTypes.contains("classic")) Review Comment: Yes okie I'll do that thanks! -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org