T- The type of the elements that this function can extract timestamps from
@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|
Extracts a timestamp from an element.
Asks the extractor if it wants to emit a watermark now that it has seen the given element.
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_VALUEto 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_VALUEif no watermark should be emitted, positive value for emitting this value as a watermark.
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.