Class WatermarkTracker

  • All Implemented Interfaces:
    Closeable, Serializable, AutoCloseable
    Direct Known Subclasses:
    JobManagerWatermarkTracker

    @PublicEvolving
    public abstract class WatermarkTracker
    extends Object
    implements Closeable, Serializable
    The watermark tracker is responsible for aggregating watermarks across distributed operators.

    It can be used for sub tasks of a single Flink source as well as multiple heterogeneous sources or other operators.

    The class essentially functions like a distributed hash table that enclosing operators can use to adopt their processing / IO rates.

    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_UPDATE_TIMEOUT_MILLIS

        public static final long DEFAULT_UPDATE_TIMEOUT_MILLIS
        See Also:
        Constant Field Values
    • Constructor Detail

      • WatermarkTracker

        public WatermarkTracker()
    • Method Detail

      • getSubtaskId

        protected String getSubtaskId()
      • getUpdateTimeoutMillis

        protected long getUpdateTimeoutMillis()
      • getUpdateTimeoutCount

        public abstract long getUpdateTimeoutCount()
      • setUpdateTimeoutMillis

        public void setUpdateTimeoutMillis​(long updateTimeoutMillis)
        Subtasks that have not provided a watermark update within the configured interval will be considered idle and excluded from target watermark calculation.
        Parameters:
        updateTimeoutMillis -
      • updateWatermark

        public abstract long updateWatermark​(long localWatermark)
        Set the current watermark of the owning subtask and return the global low watermark based on the current state snapshot. Periodically called by the enclosing consumer instance, which is responsible for any timer management etc.
        Parameters:
        localWatermark -
        Returns:
      • getCurrentTime

        protected long getCurrentTime()
      • open

        public void open​(org.apache.flink.api.common.functions.RuntimeContext context)