Class TimestampOffset

java.lang.Object
org.apache.pekko.persistence.query.Offset
org.apache.pekko.persistence.query.TimestampOffset
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product

public final class TimestampOffset extends Offset implements scala.Product, Serializable
See Also:
  • Constructor Details

    • TimestampOffset

      public TimestampOffset(Instant timestamp, Instant readTimestamp, scala.collection.immutable.Map<String,Object> seen)
  • Method Details

    • Zero

      public static TimestampOffset Zero()
    • apply

      public static TimestampOffset apply(Instant timestamp, scala.collection.immutable.Map<String,Object> seen)
    • toTimestampOffset

      public static TimestampOffset toTimestampOffset(Offset offset)
      Try to convert the Offset to a TimestampOffset. Epoch timestamp is used for NoOffset.
    • apply

      public static TimestampOffset apply(Instant timestamp, Instant readTimestamp, scala.collection.immutable.Map<String,Object> seen)
      Timestamp based offset. Since there can be several events for the same timestamp it keeps track of what sequence nrs for every persistence id that have been seen at this specific timestamp.

      The offset is exclusive, i.e. the event with the exact same sequence number will not be included in the returned stream. This means that you can use the offset that is returned in EventEnvelope as the offset parameter in a subsequent query.

      API May Change

      Parameters:
      timestamp - time when the event was stored, microsecond granularity database timestamp
      readTimestamp - time when the event was read, microsecond granularity database timestamp
      seen - List of sequence nrs for every persistence id seen at this timestamp
    • unapply

      public static scala.Option<scala.Tuple3<Instant,Instant,scala.collection.immutable.Map<String,Object>>> unapply(TimestampOffset x$0)
    • timestamp

      public Instant timestamp()
    • readTimestamp

      public Instant readTimestamp()
    • seen

      public scala.collection.immutable.Map<String,Object> seen()
    • getSeen

      public Map<String,Long> getSeen()
      Java API
    • hashCode

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

      public boolean equals(Object obj)
      Specified by:
      equals in interface scala.Equals
      Overrides:
      equals in class Object
    • copy

      public TimestampOffset copy(Instant timestamp, Instant readTimestamp, scala.collection.immutable.Map<String,Object> seen)
    • copy$default$1

      public Instant copy$default$1()
    • copy$default$2

      public Instant copy$default$2()
    • copy$default$3

      public scala.collection.immutable.Map<String,Object> copy$default$3()
    • productPrefix

      public String productPrefix()
      Specified by:
      productPrefix in interface scala.Product
    • productArity

      public int productArity()
      Specified by:
      productArity in interface scala.Product
    • productElement

      public Object productElement(int x$1)
      Specified by:
      productElement in interface scala.Product
    • productIterator

      public scala.collection.Iterator<Object> productIterator()
      Specified by:
      productIterator in interface scala.Product
    • canEqual

      public boolean canEqual(Object x$1)
      Specified by:
      canEqual in interface scala.Equals
    • productElementName

      public String productElementName(int x$1)
      Specified by:
      productElementName in interface scala.Product
    • toString

      public String toString()
      Overrides:
      toString in class Object