T
- The type of the elements that this function can extract timestamps fromAssignerWithPeriodicWatermarks
and
AssignerWithPunctuatedWatermarks
@Deprecated public interface TimestampExtractor<T> extends Function
The extractor must also keep track of the current watermark. The system will periodically
retrieve this watermark using getCurrentWatermark()
and submit it throughout the
topology.
Note: If you know that timestamps are monotonically increasing you can use
AscendingTimestampExtractor
. This will keep track of watermarks.
Modifier and Type | Method and Description |
---|---|
long |
extractTimestamp(T element,
long currentTimestamp)
Deprecated.
Extracts a timestamp from an element.
|
long |
extractWatermark(T element,
long currentTimestamp)
Deprecated.
Asks the extractor if it wants to emit a watermark now that it has seen the given element.
|
long |
getCurrentWatermark()
Deprecated.
Returns the current watermark.
|
long extractTimestamp(T element, long currentTimestamp)
element
- The element that the timestamp is extracted from.currentTimestamp
- The current internal timestamp of the element.long extractWatermark(T element, long currentTimestamp)
extractTimestamp(T, long)
. With the same element. The method
can return Long.MIN_VALUE
to indicate that no watermark should be emitted, a value of 0 or
greater will be emitted as a watermark if it is higher than the last-emitted watermark.element
- The element that we last saw.currentTimestamp
- The current timestamp of the element that we last saw.Long.MIN_VALUE
if no watermark should be emitted, positive value for
emitting this value as a watermark.long getCurrentWatermark()
Watermark
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.