Interface SubscribedTopicDescriber


@Unstable public interface SubscribedTopicDescriber
The subscribed topic describer is used by the PartitionAssignor to obtain topic and partition metadata of the subscribed topics. The interface is kept in an internal module until KIP-848 is fully implemented and ready to be released.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The number of partitions for the given topic Id.
    racksForPartition(Uuid topicId, int partition)
    Returns all the available racks associated with the replicas of the given partition.
  • Method Details

    • numPartitions

      int numPartitions(Uuid topicId)
      The number of partitions for the given topic Id.
      Parameters:
      topicId - Uuid corresponding to the topic.
      Returns:
      The number of partitions corresponding to the given topic Id, or -1 if the topic Id does not exist.
    • racksForPartition

      Set<String> racksForPartition(Uuid topicId, int partition)
      Returns all the available racks associated with the replicas of the given partition.
      Parameters:
      topicId - Uuid corresponding to the partition's topic.
      partition - Partition Id within topic.
      Returns:
      The set of racks corresponding to the replicas of the topic's partition. If the topic Id does not exist, an empty set is returned.