Record Class SessionHistoryResult.Truncated

Object
Record
akka.javasdk.agent.SessionHistoryResult.Truncated
All Implemented Interfaces:
SessionHistoryResult
Enclosing interface:
SessionHistoryResult

public static record SessionHistoryResult.Truncated(long fromSequenceNr, long toSequenceNr) extends Record implements SessionHistoryResult
The entity could not deliver the full history within its in-memory size limit. Stream the journal for this session in [fromSequenceNr, toSequenceNr] (both inclusive) to reconstruct the rest.

fromSequenceNr is the last compaction point: events before it have been superseded by the compaction summary now sitting in the entity, so re-reading them would duplicate content. When no compaction has happened yet, fromSequenceNr is 0.

toSequenceNr is the entity's sequence number at the time of the reply — i.e. the high-water mark of the in-memory state the caller is reconstructing. Bounding the journal read upward prevents events persisted after the reply (e.g. a concurrent compaction that lands between the entity reply and the journal stream) from leaking into the reconstructed history.

  • Constructor Details

    • Truncated

      public Truncated(long fromSequenceNr, long toSequenceNr)
      Creates an instance of a Truncated record class.
      Parameters:
      fromSequenceNr - the value for the fromSequenceNr record component
      toSequenceNr - the value for the toSequenceNr 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. All components in this record class 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.
    • fromSequenceNr

      public long fromSequenceNr()
      Returns the value of the fromSequenceNr record component.
      Returns:
      the value of the fromSequenceNr record component
    • toSequenceNr

      public long toSequenceNr()
      Returns the value of the toSequenceNr record component.
      Returns:
      the value of the toSequenceNr record component