public class TopicPartitionInfo extends Object
Constructor and Description |
---|
TopicPartitionInfo(int partition,
Node leader,
List<Node> replicas,
List<Node> isr)
Create an instance of this class with the provided parameters.
|
Modifier and Type | Method and Description |
---|---|
List<Node> |
isr()
Return the in-sync replicas of the partition.
|
Node |
leader()
Return the leader of the partition or null if there is none.
|
int |
partition()
Return the partition id.
|
List<Node> |
replicas()
Return the replicas of the partition in the same order as the replica assignment.
|
String |
toString() |
public TopicPartitionInfo(int partition, Node leader, List<Node> replicas, List<Node> isr)
partition
- the partition idleader
- the leader of the partition or Node.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 replicaspublic int partition()
public Node leader()
public List<Node> replicas()
public List<Node> isr()