Package io.atomix.raft.protocol
Class PollResponse
java.lang.Object
io.atomix.raft.protocol.AbstractRaftResponse
io.atomix.raft.protocol.PollResponse
- All Implemented Interfaces:
RaftMessage,RaftResponse
Server poll response.
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.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.atomix.raft.protocol.RaftResponse
RaftResponse.Status -
Field Summary
Fields inherited from class io.atomix.raft.protocol.AbstractRaftResponse
error, status -
Constructor Summary
ConstructorsConstructorDescriptionPollResponse(RaftResponse.Status status, RaftError error, long term, boolean accepted) -
Method Summary
Methods inherited from class io.atomix.raft.protocol.AbstractRaftResponse
error, status
-
Constructor Details
-
PollResponse
-
-
Method Details
-
builder
Returns a new poll response builder.- Returns:
- A new poll response builder.
-
term
public long term()Returns the responding node's current term.- Returns:
- The responding node's current term.
-
accepted
public boolean accepted()Returns a boolean indicating whether the poll was accepted.- Returns:
- Indicates whether the poll was accepted.
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractRaftResponse
-
equals
- Overrides:
equalsin classAbstractRaftResponse
-
toString
- Overrides:
toStringin classAbstractRaftResponse
-