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)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
public WatermarksWithIdleness(WatermarkGenerator<T> watermarks, java.time.Duration idleTimeout)
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.
-
-
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>
-
-