Class GlobalWatermarkThroughputLimiter

  • All Implemented Interfaces:
    ThroughputLimiter, java.io.Closeable, java.io.Serializable, java.lang.AutoCloseable

    public class GlobalWatermarkThroughputLimiter
    extends java.lang.Object
    implements ThroughputLimiter
    A ThroughputLimiter that synchronizes progress of global watermark among distributed consumers.
    See Also:
    Serialized Form
    • Field Detail

      • MAX_AHEAD_TIME_MS_CFG

        public static final java.lang.String MAX_AHEAD_TIME_MS_CFG
        Configuration key for maximum amount of time that a reader can be ahead of a global watermark in milliseconds.
        See Also:
        Constant Field Values
      • GLOBAL_WATERMARK_UPDATE_MS_CFG

        public static final java.lang.String GLOBAL_WATERMARK_UPDATE_MS_CFG
        Configuration key for number of milliseconds to pass between two updates of global watermark.
        See Also:
        Constant Field Values
      • DEFAULT_SLEEP_TIME_CFG

        public static final java.lang.String DEFAULT_SLEEP_TIME_CFG
        Configuration key for the amount of time to sleep when reader is too far ahead global watermark in milliseconds.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GlobalWatermarkThroughputLimiter

        public GlobalWatermarkThroughputLimiter()
    • Method Detail

      • setup

        public void setup​(java.util.Map<java.lang.String,​java.lang.Object> cfg)
        Description copied from interface: ThroughputLimiter
        Setup the limiter with given configuration.
        Specified by:
        setup in interface ThroughputLimiter
        Parameters:
        cfg - configuration (scoped to a (operator) defined prefix)
      • getPauseTime

        public java.time.Duration getPauseTime​(ThroughputLimiter.Context context)
        Description copied from interface: ThroughputLimiter
        Retrieve the amount of time the source should pause processing for. If the reader should proceed without pausing return Duration.ZERO. Note that this method is called for each input element and must be therefore cheap.
        Specified by:
        getPauseTime in interface ThroughputLimiter
        Parameters:
        context - context for the limiter
        Returns:
        the amount of time to pause the source for.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface ThroughputLimiter
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • readResolve

        protected java.lang.Object readResolve()