Class AscendingTimestampExtractor<T>
- java.lang.Object
-
- org.apache.flink.streaming.api.functions.timestamps.AscendingTimestampExtractor<T>
-
- Type Parameters:
T
- The type of the elements that this function can extract timestamps from
- All Implemented Interfaces:
Serializable
,TimestampAssigner<T>
,TimestampAssignerSupplier<T>
,WatermarkGeneratorSupplier<T>
,WatermarkStrategy<T>
,WatermarkStrategyWithPeriodicWatermarks<T>
@Deprecated @PublicEvolving public abstract class AscendingTimestampExtractor<T> extends Object implements WatermarkStrategyWithPeriodicWatermarks<T>
Deprecated.A timestamp assigner and watermark generator for streams where timestamps are monotonously ascending. In this case, the local watermarks for the streams are easy to generate, because they strictly follow the timestamps.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AscendingTimestampExtractor.FailingHandler
Deprecated.Handler that fails the program when timestamp monotony is violated.static class
AscendingTimestampExtractor.IgnoringHandler
Deprecated.Handler that does nothing when timestamp monotony is violated.static class
AscendingTimestampExtractor.LoggingHandler
Deprecated.Handler that only logs violations of timestamp monotony, on WARN log level.static interface
AscendingTimestampExtractor.MonotonyViolationHandler
Deprecated.Interface for handlers that handle violations of the monotonous ascending timestamps property.-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.eventtime.TimestampAssignerSupplier
TimestampAssignerSupplier.Context, TimestampAssignerSupplier.SupplierFromSerializableTimestampAssigner<T>
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.eventtime.WatermarkGeneratorSupplier
WatermarkGeneratorSupplier.Context
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.api.common.eventtime.TimestampAssigner
NO_TIMESTAMP
-
-
Constructor Summary
Constructors Constructor Description AscendingTimestampExtractor()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract long
extractAscendingTimestamp(T element)
Deprecated.Extracts the timestamp from the given element.long
extractTimestamp(T element, long elementPrevTimestamp)
Deprecated.Assigns a timestamp to an element, in milliseconds since the Epoch.Watermark
getCurrentWatermark()
Deprecated.Returns the current watermark.AscendingTimestampExtractor<T>
withViolationHandler(AscendingTimestampExtractor.MonotonyViolationHandler handler)
Deprecated.Sets the handler for violations to the ascending timestamp order.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.common.eventtime.WatermarkStrategy
getAlignmentParameters, withIdleness, withTimestampAssigner, withTimestampAssigner, withWatermarkAlignment, withWatermarkAlignment
-
Methods inherited from interface org.apache.flink.streaming.runtime.operators.util.WatermarkStrategyWithPeriodicWatermarks
createTimestampAssigner, createWatermarkGenerator
-
-
-
-
Method Detail
-
extractAscendingTimestamp
public abstract long extractAscendingTimestamp(T element)
Deprecated.Extracts the timestamp from the given element. The timestamp must be monotonically increasing.- Parameters:
element
- The element that the timestamp is extracted from.- Returns:
- The new timestamp.
-
withViolationHandler
public AscendingTimestampExtractor<T> withViolationHandler(AscendingTimestampExtractor.MonotonyViolationHandler handler)
Deprecated.Sets the handler for violations to the ascending timestamp order.- Parameters:
handler
- The violation handler to use.- Returns:
- This extractor.
-
extractTimestamp
public final long extractTimestamp(T element, long elementPrevTimestamp)
Deprecated.Description copied from interface:TimestampAssigner
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
TimestampAssigner.NO_TIMESTAMP
(=Long.MIN_VALUE
: -9223372036854775808L).- Specified by:
extractTimestamp
in interfaceTimestampAssigner<T>
- Parameters:
element
- The element that the timestamp will be assigned to.elementPrevTimestamp
- The current internal timestamp of the element, or a negative value, if no timestamp has been assigned yet.- Returns:
- The new timestamp.
-
getCurrentWatermark
public final Watermark getCurrentWatermark()
Deprecated.Description copied from interface:WatermarkStrategyWithPeriodicWatermarks
Returns the current watermark. This method is periodically called by the system to retrieve the current watermark. The method may returnnull
to indicate that no new Watermark is available.The returned watermark will be emitted only if it is non-null and its timestamp is larger than that of the previously emitted watermark (to preserve the contract of ascending watermarks). If the current watermark is still identical to the previous one, no progress in event time has happened since the previous call to this method. If a null value is returned, or the timestamp of the returned watermark is smaller than that of the last emitted one, then no new watermark will be generated.
The interval in which this method is called and Watermarks are generated depends on
ExecutionConfig.getAutoWatermarkInterval()
.- Specified by:
getCurrentWatermark
in interfaceWatermarkStrategyWithPeriodicWatermarks<T>
- Returns:
Null
, if no watermark should be emitted, or the next watermark to emit.- See Also:
Watermark
,ExecutionConfig.getAutoWatermarkInterval()
-
-