Interface TimestampAssigner<T>
-
- Type Parameters:
T- The type of the elements to which this assigner assigns timestamps.
- All Known Subinterfaces:
SerializableTimestampAssigner<T>
- All Known Implementing Classes:
IngestionTimeAssigner,RecordTimestampAssigner
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@Public @FunctionalInterface public interface TimestampAssigner<T>
ATimestampAssignerassigns 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
longvalue, but all built-in implementations represent it as the milliseconds since the Epoch (midnight, January 1, 1970 UTC), the same way asSystem.currentTimeMillis()does it.
-
-
Field Summary
Fields Modifier and Type Field Description static longNO_TIMESTAMPThe value that is passed toextractTimestamp(T, long)when there is no previous timestamp attached to the record.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longextractTimestamp(T element, long recordTimestamp)Assigns a timestamp to an element, in milliseconds since the Epoch.
-
-
-
Field Detail
-
NO_TIMESTAMP
static final long NO_TIMESTAMP
The value that is passed toextractTimestamp(T, long)when there is no previous timestamp attached to the record.- See Also:
- Constant Field Values
-
-
Method Detail
-
extractTimestamp
long extractTimestamp(T element, long recordTimestamp)
Assigns a timestamp to an element, in milliseconds since the Epoch. This is independent of any particular time zone or calendar.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: -9223372036854775808L).- Parameters:
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.- Returns:
- The new timestamp.
-
-