Skip to content

KAFKA-18904: kafka-configs.sh return resource doesn't exist message [3/N] #19808

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 4 commits into
base: trunk
Choose a base branch
from

Conversation

FrankYang0529
Copy link
Member

@FrankYang0529 FrankYang0529 commented May 25, 2025

  • Return resource doesn't exist message when users try to describe a
    non-existent resource in kafka-configs.sh and kafka-client-metrics.sh.
  • For groups type, the command checks both existent groups and
    non-existent groups but having dynamic config. If it cannot find a group
    in both conditions, return resource doesn't exist message.

Copy link
Contributor

@DL1231 DL1231 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 PR, overall LGTM.

.map(name -> new ConfigResource(entry.getKey(), name)))
.collect(Collectors.toList());
return new ListConfigResourcesResult(KafkaFuture.completedFuture(resources));

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra blank

return
}
case ClientMetricsType =>
if (adminClient.listConfigResources(java.util.Set.of(ConfigResource.Type.CLIENT_METRICS), new ListConfigResourcesOptions).all.get
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can't this just be util.Set.of?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer to leave this as java.util.xxx because we already used this pattern like:

val alterEntityMap = new java.util.HashMap[String, String]

We can do some refactor for Scala code in core module after this PR. Or we can refactor it when migrating to Java eventually.

}
case GroupType =>
if (adminClient.listGroups().all.get.stream.noneMatch(_.groupId() == name) &&
adminClient.listConfigResources(java.util.Set.of(ConfigResource.Type.GROUP), new ListConfigResourcesOptions).all.get
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

@DL1231 DL1231 left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

2 participants