Class ProgressiveTimestampsAndWatermarks<T>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.source.ProgressiveTimestampsAndWatermarks<T>
-
- Type Parameters:
T
- The type of the emitted records.
- All Implemented Interfaces:
TimestampsAndWatermarks<T>
@Internal public class ProgressiveTimestampsAndWatermarks<T> extends Object implements TimestampsAndWatermarks<T>
An implementation ofTimestampsAndWatermarks
that does periodic watermark emission and keeps track of watermarks on a per-split basis. This should be used in execution contexts where watermarks are important for efficiency/correctness, for example in STREAMING execution mode.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.operators.source.TimestampsAndWatermarks
TimestampsAndWatermarks.TimestampsAndWatermarksContextProvider, TimestampsAndWatermarks.WatermarkUpdateListener
-
-
Constructor Summary
Constructors Constructor Description ProgressiveTimestampsAndWatermarks(TimestampAssigner<T> timestampAssigner, WatermarkGeneratorSupplier<T> watermarksFactory, TimestampsAndWatermarks.TimestampsAndWatermarksContextProvider watermarksContextProvider, ProcessingTimeService timeService, Duration periodicWatermarkInterval, RelativeClock mainInputActivityClock, Clock clock, TaskIOMetricGroup taskIOMetricGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReaderOutput<T>
createMainOutput(PushingAsyncDataInput.DataOutput<T> output, TimestampsAndWatermarks.WatermarkUpdateListener watermarkUpdateListener)
Creates the ReaderOutput for the source reader, than internally runs the timestamp extraction and watermark generation.void
emitImmediateWatermark(long wallClockTimestamp)
Emit a watermark immediately.void
pauseOrResumeSplits(Collection<String> splitsToPause, Collection<String> splitsToResume)
void
startPeriodicWatermarkEmits()
Starts emitting periodic watermarks, if this implementation produces watermarks, and if periodic watermarks are configured.void
stopPeriodicWatermarkEmits()
Stops emitting periodic watermarks.
-
-
-
Constructor Detail
-
ProgressiveTimestampsAndWatermarks
public ProgressiveTimestampsAndWatermarks(TimestampAssigner<T> timestampAssigner, WatermarkGeneratorSupplier<T> watermarksFactory, TimestampsAndWatermarks.TimestampsAndWatermarksContextProvider watermarksContextProvider, ProcessingTimeService timeService, Duration periodicWatermarkInterval, RelativeClock mainInputActivityClock, Clock clock, TaskIOMetricGroup taskIOMetricGroup)
-
-
Method Detail
-
createMainOutput
public ReaderOutput<T> createMainOutput(PushingAsyncDataInput.DataOutput<T> output, TimestampsAndWatermarks.WatermarkUpdateListener watermarkUpdateListener)
Description copied from interface:TimestampsAndWatermarks
Creates the ReaderOutput for the source reader, than internally runs the timestamp extraction and watermark generation.- Specified by:
createMainOutput
in interfaceTimestampsAndWatermarks<T>
-
startPeriodicWatermarkEmits
public void startPeriodicWatermarkEmits()
Description copied from interface:TimestampsAndWatermarks
Starts emitting periodic watermarks, if this implementation produces watermarks, and if periodic watermarks are configured.Periodic watermarks are produced by periodically calling the
WatermarkGenerator.onPeriodicEmit(WatermarkOutput)
method of the underlying Watermark Generators.- Specified by:
startPeriodicWatermarkEmits
in interfaceTimestampsAndWatermarks<T>
-
stopPeriodicWatermarkEmits
public void stopPeriodicWatermarkEmits()
Description copied from interface:TimestampsAndWatermarks
Stops emitting periodic watermarks.- Specified by:
stopPeriodicWatermarkEmits
in interfaceTimestampsAndWatermarks<T>
-
emitImmediateWatermark
public void emitImmediateWatermark(long wallClockTimestamp)
Description copied from interface:TimestampsAndWatermarks
Emit a watermark immediately.- Specified by:
emitImmediateWatermark
in interfaceTimestampsAndWatermarks<T>
-
pauseOrResumeSplits
public void pauseOrResumeSplits(Collection<String> splitsToPause, Collection<String> splitsToResume)
- Specified by:
pauseOrResumeSplits
in interfaceTimestampsAndWatermarks<T>
-
-