squah-confluent commented on code in PR #18224: URL: https://github.com/apache/kafka/pull/18224#discussion_r1907920061
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroup.java: ########## @@ -1263,6 +1263,21 @@ public boolean allMembersUseClassicProtocolExcept(String memberId) { !getOrMaybeCreateMember(memberId, false).useClassicProtocol(); } + /** + * Checks whether all the members use the classic protocol except the given members. + * + * @param memberIds The members to remove. + * @return A boolean indicating whether all the members use the classic protocol. + */ + public boolean allMembersUseClassicProtocolExcept(Set<String> memberIds) { + for (ConsumerGroupMember member : members().values()) { + if (!memberIds.contains(member.memberId()) && !member.useClassicProtocol()) { + return false; + } + } Review Comment: I've rewritten the method to use member counts instead. We have to count the number of classic members in `memberIds` since it can contain mixed members. -- 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