Class TopicMetadataFetcher

java.lang.Object
org.apache.kafka.clients.consumer.internals.TopicMetadataFetcher

public class TopicMetadataFetcher extends Object
TopicMetadataFetcher is responsible for fetching the PartitionInfo for a given set of topics. All methods are blocking up to the timeout provided.
  • Constructor Details

    • TopicMetadataFetcher

      public TopicMetadataFetcher(org.apache.kafka.common.utils.LogContext logContext, ConsumerNetworkClient client, long retryBackoffMs, long retryBackoffMaxMs)
  • Method Details

    • getTopicMetadata

      public List<org.apache.kafka.common.PartitionInfo> getTopicMetadata(String topic, boolean allowAutoTopicCreation, org.apache.kafka.common.utils.Timer timer)
      Fetches the partition information for the given topic in the cluster, or null.
      Parameters:
      timer - Timer bounding how long this method can block
      Returns:
      The list of partition information, or null if the topic is unknown
    • getAllTopicMetadata

      public Map<String,List<org.apache.kafka.common.PartitionInfo>> getAllTopicMetadata(org.apache.kafka.common.utils.Timer timer)
      Fetches the partition information for all topics in the cluster.
      Parameters:
      timer - Timer bounding how long this method can block
      Returns:
      The map of topics with their partition information