public class TopicPartitionInfo extends Object
Constructor and Description |
---|
TopicPartitionInfo(int partition,
Node leader,
List<Node> replicas,
List<Node> isr) |
TopicPartitionInfo(int partition,
Node leader,
List<Node> replicas,
List<Node> isr,
List<Node> elr,
List<Node> lastKnownElr,
List<Node> observers)
Create an instance of this class with the provided parameters.
|
Modifier and Type | Method and Description |
---|---|
List<Node> |
elr()
Return the eligible leader replicas of the partition.
|
boolean |
equals(Object o) |
int |
hashCode() |
List<Node> |
isr()
Return the in-sync replicas of the partition.
|
List<Node> |
lastKnownElr()
Return the last known eligible leader 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, List<Node> elr, List<Node> lastKnownElr, List<Node> observers)
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 replicaselr
- the eligible leader replicaslastKnownElr
- the last known eligible leader replicas.observers
- The observer 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()
public List<Node> elr()
public List<Node> lastKnownElr()