Package io.atomix.raft.protocol
Class PollRequest
java.lang.Object
io.atomix.raft.protocol.AbstractRaftRequest
io.atomix.raft.protocol.PollRequest
- All Implemented Interfaces:
RaftMessage,RaftRequest
Server poll request.
Poll requests aid in the implementation of the so-called "pre-vote" protocol. They are sent by followers to all other servers prior to transitioning to the candidate state. This helps ensure that servers that can't win elections do not disrupt existing leaders when e.g. rejoining the cluster after a partition.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPollRequest(long term, String candidate, long lastLogIndex, long lastLogTerm) -
Method Summary
Modifier and TypeMethodDescriptionstatic PollRequest.Builderbuilder()Returns a new poll request builder.Returns the candidate's address.booleanfrom()inthashCode()longReturns the candidate's last log index.longReturns the candidate's last log term.longterm()Returns the requesting node's current term.toString()
-
Constructor Details
-
PollRequest
-
-
Method Details
-
builder
Returns a new poll request builder.- Returns:
- A new poll request builder.
-
term
public long term()Returns the requesting node's current term.- Returns:
- The requesting node's current term.
-
candidate
Returns the candidate's address.- Returns:
- The candidate's address.
-
lastLogIndex
public long lastLogIndex()Returns the candidate's last log index.- Returns:
- The candidate's last log index.
-
lastLogTerm
public long lastLogTerm()Returns the candidate's last log term.- Returns:
- The candidate's last log term.
-
hashCode
public int hashCode() -
equals
-
toString
-
from
-