Package io.atomix.raft.protocol
Class AppendResponse
java.lang.Object
io.atomix.raft.protocol.AbstractRaftResponse
io.atomix.raft.protocol.AppendResponse
- All Implemented Interfaces:
RaftMessage,RaftResponse
Server append entries 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
ConstructorsConstructorDescriptionAppendResponse(RaftResponse.Status status, RaftError error, long term, boolean succeeded, long lastLogIndex, long lastSnapshotIndex, long configurationIndex) -
Method Summary
Modifier and TypeMethodDescriptionstatic AppendResponse.Builderbuilder()Returns a new append response builder.longThe members current configuration index at the time of handling the append request.booleaninthashCode()longReturns the last index of the replica's log.longReturns the index of the replica's last snapshotbooleanReturns a boolean indicating whether the append was successful.longterm()Returns the requesting node's current term.toString()Methods inherited from class io.atomix.raft.protocol.AbstractRaftResponse
error, status
-
Constructor Details
-
AppendResponse
public AppendResponse(RaftResponse.Status status, RaftError error, long term, boolean succeeded, long lastLogIndex, long lastSnapshotIndex, long configurationIndex)
-
-
Method Details
-
builder
Returns a new append response builder.- Returns:
- A new append response builder.
-
term
public long term()Returns the requesting node's current term.- Returns:
- The requesting node's current term.
-
succeeded
public boolean succeeded()Returns a boolean indicating whether the append was successful.- Returns:
- Indicates whether the append was successful.
-
lastLogIndex
public long lastLogIndex()Returns the last index of the replica's log.- Returns:
- The last index of the responding replica's log.
-
lastSnapshotIndex
public long lastSnapshotIndex()Returns the index of the replica's last snapshot- Returns:
- The index of the responding replica's last snapshot
-
configurationIndex
public long configurationIndex()The members current configuration index at the time of handling the append request.If the index is 0, this may indicate that the member is older and does not include the configuration index in the response.
If the index is -1, the member has no configuration and requires a configuration update from the leader.
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractRaftResponse
-
equals
- Overrides:
equalsin classAbstractRaftResponse
-
toString
- Overrides:
toStringin classAbstractRaftResponse
-