public class PollResponse extends AbstractRaftResponse
Poll responses are sent by active servers in response to poll requests by followers to indicate
whether the responding server would vote for the requesting server if it were a candidate. This is
indicated by the accepted() field of the response.
| Modifier and Type | Class and Description |
|---|---|
static class |
PollResponse.Builder
Poll response builder.
|
RaftResponse.Status| Constructor and Description |
|---|
PollResponse(RaftResponse.Status status,
RaftError error,
long term,
boolean accepted) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepted()
Returns a boolean indicating whether the poll was accepted.
|
boolean |
equals(Object object) |
int |
hashCode() |
static PollResponse.Builder |
newBuilder()
Returns a new poll response builder.
|
long |
term()
Returns the responding node's current term.
|
String |
toString() |
error, statuspublic PollResponse(RaftResponse.Status status, RaftError error, long term, boolean accepted)
public static PollResponse.Builder newBuilder()
public long term()
public boolean accepted()
public int hashCode()
hashCode in class AbstractRaftResponsepublic boolean equals(Object object)
equals in class AbstractRaftResponsepublic String toString()
toString in class AbstractRaftResponseCopyright © 2013–2017. All rights reserved.