You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lianetm (via GitHub)" <gi...@apache.org> on 2024/11/01 15:31:17 UTC
Re: [PR] KAFKA-17593; [3/N] Track the number of subscribed members per regular expression in ConsumerGroup [kafka]
lianetm commented on code in PR #17653:
URL: https://github.com/apache/kafka/pull/17653#discussion_r1825960281
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroup.java:
##########
@@ -334,6 +342,13 @@ private void removeStaticMember(ConsumerGroupMember oldMember) {
}
}
+ /**
+ * @return The number of members subscribed to the provided regex.
+ */
+ public int numSubscribedMembers(String regex) {
+ return subscribedRegularExpressions.getOrDefault(regex, 0);
+ }
Review Comment:
That's the main gain as I see it, and it's a critical one, but we can also leverage this counter in the future when defining the strategies to re-eval all regular expressions (ie. we could decide to re-eval the "most used" first based on this subscribers count)
--
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