public class TopicPartitionInfo
extends java.lang.Object
Constructor and Description |
---|
TopicPartitionInfo(int partition,
Node leader,
java.util.List<Node> replicas,
java.util.List<Node> isr)
Create an instance of this class with the provided parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
java.util.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.
|
java.util.List<Node> |
observers()
Return the observer replicas of the partition.
|
static TopicPartitionInfo |
ofReplicasAndObservers(int partition,
Node leader,
java.util.List<Node> replicas,
java.util.List<Node> observers,
java.util.List<Node> isr) |
int |
partition()
Return the partition id.
|
java.util.List<Node> |
replicas()
Return the replicas of the partition in the same order as the replica assignment.
|
java.lang.String |
toString() |
public TopicPartitionInfo(int partition, Node leader, java.util.List<Node> replicas, java.util.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, java.util.List<Node> replicas, java.util.List<Node> observers, java.util.List<Node> isr)
public int partition()
public Node leader()
public java.util.List<Node> replicas()
@Confluent public java.util.List<Node> observers()
public java.util.List<Node> isr()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object