Package io.vertx.kafka.client.common
Class TopicPartitionInfo
java.lang.Object
io.vertx.kafka.client.common.TopicPartitionInfo
A class containing leadership, replicas and ISR information for a topic partition.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorTopicPartitionInfo(JsonObject json) Constructor (from JSON representation)Constructor -
Method Summary
Modifier and TypeMethodDescriptiongetIsr()intSet the subset of the replicas that are in syncSet the node id of the node currently acting as a leadersetPartition(int partition) Set the partition idsetReplicas(List<Node> replicas) Set the complete set of replicas for this partitiontoJson()Convert object to JSON representationtoString()
-
Constructor Details
-
TopicPartitionInfo
public TopicPartitionInfo()Constructor -
TopicPartitionInfo
Constructor- Parameters:
isr- the subset of the replicas that are in syncleader- the node id of the node currently acting as a leaderpartition- the partition idreplicas- the complete set of replicas for this partition
-
TopicPartitionInfo
Constructor (from JSON representation)- Parameters:
json- JSON representation
-
-
Method Details
-
getIsr
- Returns:
- the subset of the replicas that are in sync, that is caught-up to the leader and ready to take over as leader if the leader should fail
-
setIsr
Set the subset of the replicas that are in sync- Parameters:
isr- the subset of the replicas that are in sync- Returns:
- current instance of the class to be fluent
-
getLeader
- Returns:
- the node id of the node currently acting as a leader for this partition or null if there is no leader
-
setLeader
Set the node id of the node currently acting as a leader- Parameters:
leader- the node id of the node currently acting as a leader- Returns:
- current instance of the class to be fluent
-
getPartition
public int getPartition()- Returns:
- the partition id
-
setPartition
Set the partition id- Parameters:
partition- the partition id- Returns:
- current instance of the class to be fluent
-
getReplicas
- Returns:
- the complete set of replicas for this partition regardless of whether they are alive or up-to-date
-
setReplicas
Set the complete set of replicas for this partition- Parameters:
replicas- the complete set of replicas for this partition- Returns:
- current instance of the class to be fluent
-
toJson
Convert object to JSON representation- Returns:
- JSON representation
-
toString
-