Package io.atomix.raft.protocol
Class VersionedAppendRequest
java.lang.Object
io.atomix.raft.protocol.AbstractRaftRequest
io.atomix.raft.protocol.VersionedAppendRequest
- All Implemented Interfaces:
RaftMessage,RaftRequest
Append entries request that represent new versions (version > 1)
Append entries requests are at the core of the replication protocol. Leaders send append requests to followers to replicate and commit log entries, and followers sent append requests to passive members to replicate committed log entries.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAppend request builder. -
Constructor Summary
ConstructorsConstructorDescriptionVersionedAppendRequest(int version, long term, String leader, long prevLogIndex, long prevLogTerm, List<ReplicatableJournalRecord> entries, long commitIndex) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a new append request builder.longReturns the leader's commit index.entries()Returns the log entries to append.booleanfrom()inthashCode()leader()Returns the requesting leader address.longReturns the index of the log entry preceding the new entry.longReturns the term of the log entry preceding the new entry.longterm()Returns the requesting node's current term.toString()intversion()
-
Constructor Details
-
VersionedAppendRequest
public VersionedAppendRequest(int version, long term, String leader, long prevLogIndex, long prevLogTerm, List<ReplicatableJournalRecord> entries, long commitIndex)
-
-
Method Details
-
builder
Returns a new append request builder.- Returns:
- A new append request builder.
-
term
public long term()Returns the requesting node's current term.- Returns:
- The requesting node's current term.
-
leader
Returns the requesting leader address.- Returns:
- The leader's address.
-
prevLogIndex
public long prevLogIndex()Returns the index of the log entry preceding the new entry.- Returns:
- The index of the log entry preceding the new entry.
-
prevLogTerm
public long prevLogTerm()Returns the term of the log entry preceding the new entry.- Returns:
- The index of the term preceding the new entry.
-
entries
Returns the log entries to append.- Returns:
- A list of log entries.
-
commitIndex
public long commitIndex()Returns the leader's commit index.- Returns:
- The leader commit index.
-
hashCode
public int hashCode() -
equals
-
toString
-
version
public int version() -
from
-