Class Watermark
java.lang.Object
org.apache.flink.streaming.runtime.streamrecord.StreamElement
org.apache.flink.streaming.api.watermark.Watermark
- Direct Known Subclasses:
InternalWatermark
A Watermark tells operators that no elements with a timestamp older or equal to the watermark
timestamp should arrive at the operator. Watermarks are emitted at the sources and propagate
through the operators of the topology. Operators must themselves emit watermarks to downstream
operators using
Output.emitWatermark(Watermark).
Operators that do not internally buffer elements can always forward the watermark that they
receive. Operators that buffer elements, such as window operators, must forward a watermark after
emission of elements that is triggered by the arriving watermark.
In some cases a watermark is only a heuristic and operators should be able to deal with late elements. They can either discard those or update the result and emit updates/retractions to downstream operations.
When a source closes it will emit a final watermark with timestamp Long.MAX_VALUE.
When an operator receives this it will know that no more input will be arriving in the future.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWatermark(long timestamp) Creates a new watermark with the given timestamp in milliseconds. -
Method Summary
Methods inherited from class org.apache.flink.streaming.runtime.streamrecord.StreamElement
asLatencyMarker, asRecord, asRecordAttributes, asWatermark, asWatermarkStatus, isLatencyMarker, isRecord, isRecordAttributes, isWatermark, isWatermarkStatus
-
Field Details
-
MAX_WATERMARK
The watermark that signifies end-of-event-time. -
UNINITIALIZED
The watermark that signifies is used before any actual watermark has been generated. -
timestamp
protected final long timestampThe timestamp of the watermark in milliseconds.
-
-
Constructor Details
-
Watermark
public Watermark(long timestamp) Creates a new watermark with the given timestamp in milliseconds.
-
-
Method Details