squah-confluent commented on code in PR #20055: URL: https://github.com/apache/kafka/pull/20055#discussion_r2174878129
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/CurrentAssignmentBuilder.java: ########## @@ -317,4 +445,30 @@ private ConsumerGroupMember computeNextAssignment( .build(); } } + + /** + * Gets the set of topic IDs that the member is subscribed to. + * + * @return The set of topic IDs that the member is subscribed to. + */ + private Set<Uuid> subscribedTopicIds() { + Set<String> subscriptions = member.subscribedTopicNames(); + String subscribedTopicRegex = member.subscribedTopicRegex(); + if (subscribedTopicRegex != null && !subscribedTopicRegex.isEmpty()) { + ResolvedRegularExpression resolvedRegularExpression = resolvedRegularExpressions.get(subscribedTopicRegex); + if (resolvedRegularExpression != null) { + if (subscriptions.isEmpty()) { + subscriptions = resolvedRegularExpression.topics; + } else if (!resolvedRegularExpression.topics.isEmpty()) { + subscriptions = new UnionSet<>(subscriptions, resolvedRegularExpression.topics); + } + } else { + // Treat an unresolved regex as matching no topics, to be conservative. + } + } + + TopicIds.TopicResolver topicResolver = new TopicIds.CachedTopicResolver(metadataImage.topics()); Review Comment: Good point, we can remove the cache. -- 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