Package io.atomix.raft.protocol
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
ConstructorsConstructorDescriptionInternalAppendRequest(long term, MemberId leader, long prevLogIndex, long prevLogTerm, long commitIndex, List<? extends ReplicatableRaftRecord> entries) Creates an instance of aInternalAppendRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecommitIndexrecord component.List<? extends ReplicatableRaftRecord> entries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.leader()Returns the value of theleaderrecord component.longReturns the value of theprevLogIndexrecord component.longReturns the value of theprevLogTermrecord component.longterm()Returns the value of thetermrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InternalAppendRequest
public InternalAppendRequest(long term, MemberId leader, long prevLogIndex, long prevLogTerm, long commitIndex, List<? extends ReplicatableRaftRecord> entries) Creates an instance of aInternalAppendRequestrecord class.- Parameters:
term- the value for thetermrecord componentleader- the value for theleaderrecord componentprevLogIndex- the value for theprevLogIndexrecord componentprevLogTerm- the value for theprevLogTermrecord componentcommitIndex- the value for thecommitIndexrecord componententries- the value for theentriesrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
term
public long term()Returns the value of thetermrecord component.- Returns:
- the value of the
termrecord component
-
leader
Returns the value of theleaderrecord component.- Returns:
- the value of the
leaderrecord component
-
prevLogIndex
public long prevLogIndex()Returns the value of theprevLogIndexrecord component.- Returns:
- the value of the
prevLogIndexrecord component
-
prevLogTerm
public long prevLogTerm()Returns the value of theprevLogTermrecord component.- Returns:
- the value of the
prevLogTermrecord component
-
commitIndex
public long commitIndex()Returns the value of thecommitIndexrecord component.- Returns:
- the value of the
commitIndexrecord component
-
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-