Class WatermarksWithIdleness<T>
- java.lang.Object
-
- org.apache.flink.api.common.eventtime.WatermarksWithIdleness<T>
-
- All Implemented Interfaces:
WatermarkGenerator<T>
@Public public class WatermarksWithIdleness<T> extends Object implements WatermarkGenerator<T>
A WatermarkGenerator that adds idleness detection to another WatermarkGenerator. If no events come within a certain time (timeout duration) then this generator marks the stream as idle, until the next watermark is generated.
-
-
Constructor Summary
Constructors Constructor Description WatermarksWithIdleness(WatermarkGenerator<T> watermarks, java.time.Duration idleTimeout)Deprecated.WatermarksWithIdleness(WatermarkGenerator<T> watermarks, java.time.Duration idleTimeout, RelativeClock clock)Creates a new WatermarksWithIdleness generator to the given generator idleness detection with the given timeout.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEvent(T event, long eventTimestamp, WatermarkOutput output)Called for every event, allows the watermark generator to examine and remember the event timestamps, or to emit a watermark based on the event itself.voidonPeriodicEmit(WatermarkOutput output)Called periodically, and might emit a new watermark, or not.
-
-
-
Constructor Detail
-
WatermarksWithIdleness
@Deprecated public WatermarksWithIdleness(WatermarkGenerator<T> watermarks, java.time.Duration idleTimeout)
Deprecated.This is not used anymore, but it's technically part of thePublicAPI. Please useWatermarksWithIdleness(WatermarkGenerator, Duration, RelativeClock)instead.
-
WatermarksWithIdleness
public WatermarksWithIdleness(WatermarkGenerator<T> watermarks, java.time.Duration idleTimeout, RelativeClock clock)
Creates a new WatermarksWithIdleness generator to the given generator idleness detection with the given timeout.- Parameters:
watermarks- The original watermark generator.idleTimeout- The timeout for the idleness detection.clock- The clock that will be used to measure idleness period. It is expected that this clock will hide periods when thisWatermarkGeneratorhas been blocked from making any progress despite availability of records on the input.
-
-
Method Detail
-
onEvent
public void onEvent(T event, long eventTimestamp, WatermarkOutput output)
Description copied from interface:WatermarkGeneratorCalled for every event, allows the watermark generator to examine and remember the event timestamps, or to emit a watermark based on the event itself.- Specified by:
onEventin interfaceWatermarkGenerator<T>
-
onPeriodicEmit
public void onPeriodicEmit(WatermarkOutput output)
Description copied from interface:WatermarkGeneratorCalled periodically, and might emit a new watermark, or not.The interval in which this method is called and Watermarks are generated depends on
ExecutionConfig.getAutoWatermarkInterval().- Specified by:
onPeriodicEmitin interfaceWatermarkGenerator<T>
-
-