Class Watermark

java.lang.Object
org.nuxeo.lib.stream.computation.Watermark
All Implemented Interfaces:
Comparable<Watermark>

public final class Watermark extends Object implements Comparable<Watermark>
Watermark represents a point in time. This point in time is composed of a millisecond timestamp and a sequence. There is also a state to denote if the point in time is reached (completed) or not. Watermark are immutable.
Since:
9.3
  • Field Details

    • LOWEST

      public static final Watermark LOWEST
    • timestamp

      protected final long timestamp
    • sequence

      protected final short sequence
    • completed

      protected final boolean completed
    • value

      protected final long value
  • Method Details

    • ofValue

      public static Watermark ofValue(long watermarkValue)
    • ofNow

      public static Watermark ofNow()
    • ofTimestamp

      public static Watermark ofTimestamp(long timestamp)
    • ofTimestamp

      public static Watermark ofTimestamp(long timestamp, short sequence)
    • completedOf

      public static Watermark completedOf(Watermark watermark)
    • getValue

      public long getValue()
    • isCompleted

      public boolean isCompleted()
    • getSequence

      public short getSequence()
    • getTimestamp

      public long getTimestamp()
    • isDone

      public boolean isDone(long timestamp)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Watermark o)
      Specified by:
      compareTo in interface Comparable<Watermark>