Skip to content

KAFKA-17747: [3/N] Get rid of TopicMetadata in SubscribedTopicDescriberImpl #19611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

FrankYang0529
Copy link
Member

@FrankYang0529 FrankYang0529 commented May 1, 2025

Replace TopicMetadata with subscriptionTopicIdSet and
MetadataImage in SubscribedTopicDescriberImpl and
TargetAssignmentBuilder.

@dajac dajac self-requested a review May 3, 2025 14:53
@FrankYang0529 FrankYang0529 changed the title KAFKA-17747: [3/N] Get rid of TopicMetadata in SubscribedTopicDescriberImpl (wip) KAFKA-17747: [3/N] Get rid of TopicMetadata in SubscribedTopicDescriberImpl May 6, 2025
Copy link
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FrankYang0529 Thanks for the patch! I have started to look into it and I left a few high level comments to start with. Out of curiosity, have you tried to run the benchmarks before and after the change to see the impact?

@@ -3652,11 +3652,11 @@ private Assignment updateTargetAssignment(
new TargetAssignmentBuilder.ConsumerTargetAssignmentBuilder(group.groupId(), groupEpoch, consumerGroupAssignors.get(preferredServerAssignor))
.withMembers(group.members())
.withStaticMembers(group.staticMembers())
.withSubscriptionMetadata(subscriptionMetadata)
.withSubscriptionTopicIdSet(subscriptionMetadata.values().stream().map(TopicMetadata::id).collect(Collectors.toSet()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that our goal is to get rid of subscriptionMetadata so it is a bit surprising to still rely on it here. Could we avoid it?

* @return The set of topic Ids.
*/
public Set<Uuid> subscriptionTopicIdSet() {
return this.subscriptionTopicIdSet;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given how this is used (mainly in tests), I think that we should rather try to remove it. Would it be possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants