public class PollRequest extends AbstractRaftRequest
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
PollRequest.Builder
Poll request builder.
|
| Constructor and Description |
|---|
PollRequest(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 PollRequest.Builder |
newBuilder()
Returns a new poll request builder.
|
long |
term()
Returns the requesting node's current term.
|
String |
toString() |
public PollRequest(long term,
String candidate,
long lastLogIndex,
long lastLogTerm)
public static PollRequest.Builder newBuilder()
public long term()
public MemberId candidate()
public long lastLogIndex()
public long lastLogTerm()
Copyright © 2013–2017. All rights reserved.