@PublicEvolving public final class Watermark extends StreamElement
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.
| Modifier and Type | Field and Description |
|---|---|
static Watermark |
MAX_WATERMARK
The watermark that signifies end-of-event-time.
|
static Watermark |
UNINITIALIZED
The watermark that signifies is used before any actual watermark has been generated.
|
| Constructor and Description |
|---|
Watermark(long timestamp)
Creates a new watermark with the given timestamp in milliseconds.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
long |
getTimestamp()
Returns the timestamp associated with this
Watermark in milliseconds. |
int |
hashCode() |
String |
toString() |
asLatencyMarker, asRecord, asStreamStatus, asWatermark, isLatencyMarker, isRecord, isStreamStatus, isWatermarkpublic static final Watermark MAX_WATERMARK
public static final Watermark UNINITIALIZED
public Watermark(long timestamp)
public long getTimestamp()
Watermark in milliseconds.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.