Interface SubscribedTopicDescriber
public interface SubscribedTopicDescriber
The subscribed topic describer is used by the
PartitionAssignor
to obtain topic and partition metadata of the subscribed topics.-
Method Summary
Modifier and TypeMethodDescriptionintnumPartitions(org.apache.kafka.common.Uuid topicId) The number of partitions for the given topic Id.racksForPartition(org.apache.kafka.common.Uuid topicId, int partition) Returns all the available racks associated with the replicas of the given partition.
-
Method Details
-
numPartitions
int numPartitions(org.apache.kafka.common.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
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.
-