public class Replica extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Replica>
Modifier and Type | Field and Description |
---|---|
static Replica |
MAX_REPLICA |
static Replica |
MIN_REPLICA |
Modifier and Type | Method and Description |
---|---|
Broker |
broker()
Get broker that the replica resides in.
|
int |
compareTo(Replica o)
Compare by (1) offline / online status (2) partition id then (2) original broker id then (3) topic name.
|
Disk |
disk()
Get disk that the replica resides in.
|
boolean |
equals(java.lang.Object o) |
Load |
getFollowerLoadFromLeader()
Get the expected load if this replica becomes a follower replica.
|
java.util.Map<java.lang.String,java.lang.Object> |
getJsonStructureForLoad() |
int |
hashCode() |
boolean |
isCurrentOffline()
Check whether the replica is currently offline.
|
boolean |
isImmigrant()
Check whether the replica is an immigrant replica of the broker.
|
boolean |
isLeader()
Check the leadership status of the broker.
|
boolean |
isObserver()
Check whether the replica is an observer.
|
boolean |
isOriginalOffline()
Get the original state of the replica before rebalance.
|
Load |
load()
Get the replica load for each resource.
|
Broker |
originalBroker()
Get the original broker of this replica before rebalance.
|
Disk |
originalDisk()
Get disk that the replica originally resides in.
|
void |
setObservership(boolean isObserver)
Set observership status of the replica
|
org.apache.kafka.common.TopicPartition |
topicPartition()
Get the topic partition.
|
java.lang.String |
toString()
Get string representation of the
Replica . |
void |
writeTo(java.io.OutputStream out)
Output writing string representation of this class to the stream.
|
public static final Replica MIN_REPLICA
public static final Replica MAX_REPLICA
public boolean isOriginalOffline()
public boolean isCurrentOffline()
public org.apache.kafka.common.TopicPartition topicPartition()
public Load load()
public Broker originalBroker()
public Broker broker()
public boolean isLeader()
public boolean isObserver()
public boolean isImmigrant()
public void setObservership(boolean isObserver)
public Disk originalDisk()
ClusterModel
, null will be returned.public Disk disk()
ClusterModel
, null will be returned.public Load getFollowerLoadFromLeader()
public java.util.Map<java.lang.String,java.lang.Object> getJsonStructureForLoad()
public void writeTo(java.io.OutputStream out) throws java.io.IOException
out
- the output stream.java.io.IOException
public java.lang.String toString()
Replica
.toString
in class java.lang.Object
public int compareTo(Replica o)
compareTo
in interface java.lang.Comparable<Replica>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object