Interface ReplicatedLogEntry

  • All Known Implementing Classes:
    SimpleReplicatedLogEntry

    public interface ReplicatedLogEntry
    Represents one entry in the replicated log.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Payload getData()
      Returns the payload/data to be replicated.
      long getIndex()
      Returns the index of the entry.
      long getTerm()
      Returns the term of the entry.
      boolean isPersistencePending()
      Checks if persistence is pending for this entry.
      int serializedSize()
      Return the estimate of serialized size of this entry when passed through serialization.
      void setPersistencePending​(boolean pending)
      Sets whether or not persistence is pending for this entry.
      int size()
      Returns the size of the entry in bytes.
    • Method Detail

      • getData

        Payload getData()
        Returns the payload/data to be replicated.
        Returns:
        the payload/data
      • getTerm

        long getTerm()
        Returns the term of the entry.
        Returns:
        the term
      • getIndex

        long getIndex()
        Returns the index of the entry.
        Returns:
        the index
      • size

        int size()
        Returns the size of the entry in bytes. An approximate number may be good enough.
        Returns:
        the size of the entry in bytes.
      • serializedSize

        int serializedSize()
        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.
        Returns:
        An estimate of serialized size.
      • isPersistencePending

        boolean isPersistencePending()
        Checks if persistence is pending for this entry.
        Returns:
        true if persistence is pending, false otherwise.
      • setPersistencePending

        void setPersistencePending​(boolean pending)
        Sets whether or not persistence is pending for this entry.
        Parameters:
        pending - the new setting.