public class FollowerState extends Object
nextIndex
: index of the next log entry to send to that server
(initialized to leader's lastLogIndex + 1
)matchIndex
: index of highest log entry known to be replicated
on server (initialized to 0, increases monotonically)appendRequestBackoff
: a boolean flag indicating that leader is still
waiting for a response to the last sent append requestModifier and Type | Method and Description |
---|---|
void |
appendRequestAckReceived()
Clears the flag for the append request backoff
and updates the timestamp of append entries response
|
long |
appendRequestAckTimestamp()
Returns timestamp of the last append entries response
|
boolean |
completeAppendRequestBackoffRound()
Completes a single round of append request backoff.
|
boolean |
isAppendRequestBackoffSet()
Returns whether leader is waiting for response of the last append request.
|
long |
matchIndex()
Returns the match index for follower.
|
void |
matchIndex(long matchIndex)
Sets the match index for follower.
|
long |
nextIndex()
Returns the next index for follower.
|
void |
nextIndex(long nextIndex)
Sets the next index for follower.
|
void |
setAppendRequestBackoff()
Sets the flag for append request backoff.
|
void |
setMaxAppendRequestBackoff()
Sets the flag for append request backoff to max value.
|
String |
toString() |
public long matchIndex()
public void matchIndex(long matchIndex)
public long nextIndex()
public void nextIndex(long nextIndex)
public boolean isAppendRequestBackoffSet()
public void setAppendRequestBackoff()
public void setMaxAppendRequestBackoff()
public boolean completeAppendRequestBackoffRound()
0
, false otherwisepublic void appendRequestAckReceived()
public long appendRequestAckTimestamp()
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.