Class VersionedAppendRequest

java.lang.Object
io.atomix.raft.protocol.AbstractRaftRequest
io.atomix.raft.protocol.VersionedAppendRequest
All Implemented Interfaces:
RaftMessage, RaftRequest

public class VersionedAppendRequest extends AbstractRaftRequest
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.

  • Constructor Details

    • VersionedAppendRequest

      public VersionedAppendRequest(int version, long term, String leader, long prevLogIndex, long prevLogTerm, List<ReplicatableJournalRecord> entries, long commitIndex)
  • Method Details

    • builder

      public static VersionedAppendRequest.Builder 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

      public MemberId 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

      public List<ReplicatableJournalRecord> 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()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • version

      public int version()
    • from

      public MemberId from()