Package org.apache.kafka.common
Class TopicPartitionInfo
java.lang.Object
org.apache.kafka.common.TopicPartitionInfo
A class containing leadership, replicas and ISR information for a topic partition.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
isr()
Return the in-sync replicas of the partition.leader()
Return the leader of the partition or null if there is none.int
Return the partition id.replicas()
Return the replicas of the partition in the same order as the replica assignment.toString()
-
Constructor Details
-
TopicPartitionInfo
Create an instance of this class with the provided parameters.- Parameters:
partition
- the partition idleader
- the leader of the partition orNode.noNode()
if there is none.replicas
- the replicas of the partition in the same order as the replica assignment (the preferred replica is the head of the list)isr
- the in-sync replicas
-
-
Method Details
-
partition
public int partition()Return the partition id. -
leader
Return the leader of the partition or null if there is none. -
replicas
Return the replicas of the partition in the same order as the replica assignment. The preferred replica is the head of the list. Brokers with version lower than 0.11.0.0 return the replicas in unspecified order due to a bug. -
isr
Return the in-sync replicas of the partition. Note that the ordering of the result is unspecified. -
toString
-
equals
-
hashCode
public int hashCode()
-