Record Class InternalAppendRequest

java.lang.Object
java.lang.Record
io.atomix.raft.protocol.InternalAppendRequest

public record InternalAppendRequest(long term, MemberId leader, long prevLogIndex, long prevLogTerm, long commitIndex, List<? extends ReplicatableRaftRecord> entries) extends Record
Used by RaftRoles to handle AppendRequest from multiple versions uniformly.
  • Constructor Summary

    Constructors
    Constructor
    Description
    InternalAppendRequest(long term, MemberId leader, long prevLogIndex, long prevLogTerm, long commitIndex, List<? extends ReplicatableRaftRecord> entries)
    Creates an instance of a InternalAppendRequest record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the commitIndex record component.
    Returns the value of the entries record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the leader record component.
    long
    Returns the value of the prevLogIndex record component.
    long
    Returns the value of the prevLogTerm record component.
    long
    Returns the value of the term record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • InternalAppendRequest

      public InternalAppendRequest(long term, MemberId leader, long prevLogIndex, long prevLogTerm, long commitIndex, List<? extends ReplicatableRaftRecord> entries)
      Creates an instance of a InternalAppendRequest record class.
      Parameters:
      term - the value for the term record component
      leader - the value for the leader record component
      prevLogIndex - the value for the prevLogIndex record component
      prevLogTerm - the value for the prevLogTerm record component
      commitIndex - the value for the commitIndex record component
      entries - the value for the entries record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • term

      public long term()
      Returns the value of the term record component.
      Returns:
      the value of the term record component
    • leader

      public MemberId leader()
      Returns the value of the leader record component.
      Returns:
      the value of the leader record component
    • prevLogIndex

      public long prevLogIndex()
      Returns the value of the prevLogIndex record component.
      Returns:
      the value of the prevLogIndex record component
    • prevLogTerm

      public long prevLogTerm()
      Returns the value of the prevLogTerm record component.
      Returns:
      the value of the prevLogTerm record component
    • commitIndex

      public long commitIndex()
      Returns the value of the commitIndex record component.
      Returns:
      the value of the commitIndex record component
    • entries

      public List<? extends ReplicatableRaftRecord> entries()
      Returns the value of the entries record component.
      Returns:
      the value of the entries record component