T
- The type of the elements to which this assigner assigns timestamps.@Public @FunctionalInterface public interface TimestampAssigner<T>
TimestampAssigner
assigns event time timestamps to elements. These timestamps are used
by all functions that operate on event time, for example event time windows.
Timestamps can be an arbitrary long
value, but all built-in implementations represent
it as the milliseconds since the Epoch (midnight, January 1, 1970 UTC), the same way as System.currentTimeMillis()
does it.
Modifier and Type | Field and Description |
---|---|
static long |
NO_TIMESTAMP
The value that is passed to
extractTimestamp(T, long) when there is no previous timestamp
attached to the record. |
Modifier and Type | Method and Description |
---|---|
long |
extractTimestamp(T element,
long recordTimestamp)
Assigns a timestamp to an element, in milliseconds since the Epoch.
|
static final long NO_TIMESTAMP
extractTimestamp(T, long)
when there is no previous timestamp
attached to the record.long extractTimestamp(T element, long recordTimestamp)
The method is passed the previously assigned timestamp of the element. That previous
timestamp may have been assigned from a previous assigner. If the element did not carry a
timestamp before, this value is NO_TIMESTAMP
(= Long.MIN_VALUE
: ).
element
- The element that the timestamp will be assigned to.recordTimestamp
- The current internal timestamp of the element, or a negative value, if
no timestamp has been assigned yet.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.