public class VoteRequest extends AbstractRaftRequest
Vote requests are sent by candidate servers during an election to determine whether they should become the leader for a cluster. Vote requests contain the necessary information for followers to determine whether a candidate should receive their vote based on log and other information.
| Modifier and Type | Class and Description |
|---|---|
static class |
VoteRequest.Builder
Vote request builder.
|
| Constructor and Description |
|---|
VoteRequest(long term,
String candidate,
long lastLogIndex,
long lastLogTerm) |
| Modifier and Type | Method and Description |
|---|---|
MemberId |
candidate()
Returns the candidate's address.
|
boolean |
equals(Object object) |
int |
hashCode() |
long |
lastLogIndex()
Returns the candidate's last log index.
|
long |
lastLogTerm()
Returns the candidate's last log term.
|
static VoteRequest.Builder |
newBuilder()
Returns a new vote request builder.
|
long |
term()
Returns the requesting node's current term.
|
String |
toString() |
public VoteRequest(long term,
String candidate,
long lastLogIndex,
long lastLogTerm)
public static VoteRequest.Builder newBuilder()
public long term()
public MemberId candidate()
public long lastLogIndex()
public long lastLogTerm()
Copyright © 2013–2017. All rights reserved.