T
- The type of the elements to which this assigner assigns timestamps.public interface TimestampAssigner<T> extends Function
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 are represented in milliseconds since the Epoch (midnight, January 1, 1970 UTC).
Modifier and Type | Method and Description |
---|---|
long |
extractTimestamp(T element,
long previousElementTimestamp)
Assigns a timestamp to an element, in milliseconds since the Epoch.
|
long extractTimestamp(T element, long previousElementTimestamp)
The method is passed the previously assigned timestamp of the element.
That previous timestamp may have been assigned from a previous assigner,
by ingestion time. If the element did not carry a timestamp before, this value is
Long.MIN_VALUE
.
element
- The element that the timestamp will be assigned to.previousElementTimestamp
- The previous internal timestamp of the element,
or a negative value, if no timestamp has been assigned yet.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.