public class PartitionInfo extends Object
Constructor and Description |
---|
PartitionInfo()
Constructor
|
PartitionInfo(JsonObject json)
Constructor (from JSON representation)
|
PartitionInfo(List<Node> inSyncReplicas,
Node leader,
int partition,
List<Node> replicas,
String topic)
Constructor
|
Modifier and Type | Method and Description |
---|---|
List<Node> |
getInSyncReplicas() |
Node |
getLeader() |
int |
getPartition() |
List<Node> |
getReplicas() |
String |
getTopic() |
PartitionInfo |
setInSyncReplicas(List<Node> inSyncReplicas)
Set the subset of the replicas that are in sync
|
PartitionInfo |
setLeader(Node leader)
Set the node id of the node currently acting as a leader
|
PartitionInfo |
setPartition(int partition)
Set the partition id
|
PartitionInfo |
setReplicas(List<Node> replicas)
Set the complete set of replicas for this partition
|
PartitionInfo |
setTopic(String topic)
Set the topic name
|
JsonObject |
toJson()
Convert object to JSON representation
|
String |
toString() |
public PartitionInfo()
public PartitionInfo(List<Node> inSyncReplicas, Node leader, int partition, List<Node> replicas, String topic)
inSyncReplicas
- 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 partitiontopic
- the topic namepublic PartitionInfo(JsonObject json)
json
- JSON representationpublic List<Node> getInSyncReplicas()
public PartitionInfo setInSyncReplicas(List<Node> inSyncReplicas)
inSyncReplicas
- the subset of the replicas that are in syncpublic Node getLeader()
public PartitionInfo setLeader(Node leader)
leader
- the node id of the node currently acting as a leaderpublic int getPartition()
public PartitionInfo setPartition(int partition)
partition
- the partition idpublic List<Node> getReplicas()
public PartitionInfo setReplicas(List<Node> replicas)
replicas
- the complete set of replicas for this partitionpublic String getTopic()
public PartitionInfo setTopic(String topic)
topic
- the topic namepublic JsonObject toJson()
Copyright © 2021 Eclipse. All rights reserved.