Class SimpleReplicatedLogEntry

java.lang.Object
org.opendaylight.controller.cluster.raft.persisted.SimpleReplicatedLogEntry
All Implemented Interfaces:
Serializable, ReplicatedLogEntry, LogEntry, EntryMeta

@NonNullByDefault public final class SimpleReplicatedLogEntry extends Object implements ReplicatedLogEntry, Serializable
A ReplicatedLogEntry implementation.
Author:
Thomas Pantelis
See Also:
  • Constructor Details

    • SimpleReplicatedLogEntry

      public SimpleReplicatedLogEntry(long index, long term, Payload payload)
      Constructs an instance.
      Parameters:
      index - the index
      term - the term
      payload - the payload
  • Method Details

    • of

      public static SimpleReplicatedLogEntry of(LogEntry entry)
    • command

      public Payload command()
      Description copied from interface: LogEntry
      Returns this entry's StateMachineCommand.
      Specified by:
      command in interface LogEntry
      Specified by:
      command in interface ReplicatedLogEntry
      Returns:
      this entry's StateMachineCommand
    • index

      public long index()
      Description copied from interface: EntryMeta
      Returns the index of the entry.
      Specified by:
      index in interface EntryMeta
      Returns:
      the index
    • term

      public long term()
      Description copied from interface: EntryMeta
      Returns the term of the entry.
      Specified by:
      term in interface EntryMeta
      Returns:
      the term
    • size

      public int size()
      Description copied from interface: ReplicatedLogEntry
      Returns the size of the entry in bytes. An approximate number may be good enough.
      Specified by:
      size in interface ReplicatedLogEntry
      Returns:
      the size of the entry in bytes.
    • serializedSize

      public int serializedSize()
      Description copied from interface: ReplicatedLogEntry
      Return the estimate of serialized size of this entry when passed through serialization. The estimate needs to be reasonably accurate and should err on the side of caution and report a slightly-higher size in face of uncertainty.
      Specified by:
      serializedSize in interface ReplicatedLogEntry
      Returns:
      An estimate of serialized size.
    • isPersistencePending

      public boolean isPersistencePending()
      Description copied from interface: ReplicatedLogEntry
      Checks if persistence is pending for this entry.
      Specified by:
      isPersistencePending in interface ReplicatedLogEntry
      Returns:
      true if persistence is pending, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object