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 |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
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.
|
List<Node> |
observers()
Return the observer replicas of the partition.
|
static TopicPartitionInfo |
ofReplicasAndObservers(int partition,
Node leader,
List<Node> replicas,
List<Node> observers,
List<Node> isr) |
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 replicas@Confluent public static TopicPartitionInfo ofReplicasAndObservers(int partition, Node leader, List<Node> replicas, List<Node> observers, List<Node> isr)
public int partition()
public Node leader()
public List<Node> replicas()
@Confluent public List<Node> observers()
public List<Node> isr()