satishd commented on a change in pull request #9769: URL: https://github.com/apache/kafka/pull/9769#discussion_r564641591
########## File path: core/src/main/scala/kafka/admin/TopicCommand.scala ########## @@ -313,42 +314,59 @@ object TopicCommand extends Logging { } override def describeTopic(opts: TopicCommandOptions): Unit = { - val topics = getTopics(opts.topic, opts.excludeInternalTopics) - ensureTopicExists(topics, opts.topic, !opts.ifExists) + // if topicId is provided and not zero, will use topicId regardless of topic name + val useTopicId = opts.topicId.map(Uuid.fromString).nonEmpty Review comment: Based on the above comment, does not it need to handle `UUID.ZERO_UUID` too? ########## File path: clients/src/main/java/org/apache/kafka/clients/admin/TopicListing.java ########## @@ -17,24 +17,36 @@ package org.apache.kafka.clients.admin; +import org.apache.kafka.common.Uuid; + /** * A listing of a topic in the cluster. */ public class TopicListing { private final String name; + private final Uuid topicId; private final boolean internal; /** * Create an instance with the specified parameters. * * @param name The topic name + * @param topicId The topic id. * @param internal Whether the topic is internal to Kafka */ - public TopicListing(String name, boolean internal) { + public TopicListing(String name, Uuid topicId, boolean internal) { + this.topicId = topicId; this.name = name; this.internal = internal; } + /** + * The name of the topic. Review comment: typo: should have been "The id ~~name~~ of the topic" ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org