@Public public final class Watermark extends Object implements Serializable
Watermarks are created at the sources and propagate through the streams and operators.
In some cases a watermark is only a heuristic, meaning some events with a lower timestamp may still follow. In that case, it is up to the logic of the operators to decide what to do with the "late events". Operators can for example ignore these late events, route them to a different stream, or send update to their previously emitted results.
When a source reaches the end of the input, it emits a final watermark with timestamp Long.MAX_VALUE
, indicating the "end of time".
Note: A stream's time starts with a watermark of Long.MIN_VALUE
. That means that all
records in the stream with a timestamp of Long.MIN_VALUE
are immediately late.
Modifier and Type | Field and Description |
---|---|
static Watermark |
MAX_WATERMARK
The watermark that signifies end-of-event-time.
|
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) |
String |
getFormattedTimestamp()
Formats the timestamp of this watermark, assuming it is a millisecond timestamp.
|
long |
getTimestamp()
Returns the timestamp associated with this Watermark.
|
int |
hashCode() |
String |
toString() |
public static final Watermark MAX_WATERMARK
public Watermark(long timestamp)
public long getTimestamp()
public String getFormattedTimestamp()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.