Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state:  Under Discussion  Discarded

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread] 

JIRA: here 

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently AdminClient supports describeTopics(Collection<String> topicNames) method API for describing topics and listTopics() API for listing topic name listingnames.
To describe all topics, users currently we need to use listTopics() to get all topic names and pass supply the name list to describeTopics

 In large clusters, the MetadataResponse can be large and sending multiple MetadataRequests can be inefficient.

Since "describe all topics" is a common operation, We propose to add describeTopics() method API to get all topic descriptions in single call.
This will be simple to use and avoids additional metadata requests.

Public Interfaces

API Changes

We will introduce new API methods to AdminClient to describe all topics. New result class "DescribeAllTopicsResult" will be added. 


code
Code Block
languagejava
titleAdminClient.java
/**
 * Describe all topics in the cluster, with the default options.
 */
public DescribeAllTopicsResult describeTopics() {
    return describeTopics(new DescribeTopicsOptions());
}

/**
 * Describe all topics in the cluster.
 *
 * @return                  The DescribeAllTopicsResult.
 */
public abstract DescribeAllTopicsResult describeTopics(DescribeTopicsOptions options);



New result class "DescribeAllTopicsResult" will be added.


Code Block
languagejava
titleDescribeAllTopicsResult
/**
 * The result of the {@link KafkaAdminClient#describeTopics()} call.
 */
public class DescribeAllTopicsResult {
    private final KafkaFuture<Collection<TopicDescription>> future;

    DescribeAllTopicsResult(KafkaFuture<Collection<TopicDescription>> future) {
        this.future = future;
    }

    public KafkaFuture<Collection<TopicDescription>> value() {
        return future;
    }
}


Compatibility, Deprecation, and Migration Plan

  • There won’t be any compatibility issues