Record Class ReplicatableJournalRecord

java.lang.Object
java.lang.Record
io.atomix.raft.protocol.ReplicatableJournalRecord
All Implemented Interfaces:
ReplicatableRaftRecord

public record ReplicatableJournalRecord(long term, long index, long checksum, byte[] serializedJournalRecord) extends Record implements ReplicatableRaftRecord
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReplicatableJournalRecord(long term, long index, long checksum, byte[] serializedJournalRecord)
    Creates an instance of a ReplicatableJournalRecord record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the approximate size needed when serializing this class.
    long
    Returns the value of the checksum record component.
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    long
    Returns the value of the index record component.
    byte[]
    Returns the value of the serializedJournalRecord record component.
    long
    Returns the value of the term record component.
    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

    • ReplicatableJournalRecord

      public ReplicatableJournalRecord(long term, long index, long checksum, byte[] serializedJournalRecord)
      Creates an instance of a ReplicatableJournalRecord record class.
      Parameters:
      term - the value for the term record component
      index - the value for the index record component
      checksum - the value for the checksum record component
      serializedJournalRecord - the value for the serializedJournalRecord record component
  • Method Details

    • equals

      public 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.
    • hashCode

      public 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
    • toString

      public 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
    • approximateSize

      public int approximateSize()
      Returns the approximate size needed when serializing this class. The exact size depends on the serializer.
      Returns:
      approximate size
    • term

      public long term()
      Returns the value of the term record component.
      Specified by:
      term in interface ReplicatableRaftRecord
      Returns:
      the value of the term record component
    • index

      public long index()
      Returns the value of the index record component.
      Specified by:
      index in interface ReplicatableRaftRecord
      Returns:
      the value of the index record component
    • checksum

      public long checksum()
      Returns the value of the checksum record component.
      Returns:
      the value of the checksum record component
    • serializedJournalRecord

      public byte[] serializedJournalRecord()
      Returns the value of the serializedJournalRecord record component.
      Returns:
      the value of the serializedJournalRecord record component