public class Leader extends Object
Identified by the node identifier
and a monotonically increasing term number.
The term number is incremented by one every time a new node is elected as leader.
Also available is the system clock time at the instant when this node was elected as leader.
Keep in mind though that as with any system clock based time stamps this particular information
susceptible to clock skew and should only be relied on for simple diagnostic purposes.
Constructor and Description |
---|
Leader(NodeId nodeId,
long term,
long termStartTime) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
NodeId |
nodeId()
Returns the identifier for of leader.
|
long |
term()
Returns the leader's term.
|
long |
termStartTime()
Returns the system time when the current leadership term started.
|
String |
toString() |
public Leader(NodeId nodeId, long term, long termStartTime)
public NodeId nodeId()
public long term()
public long termStartTime()