Interface InternalTimeServiceManager<K>
- Type Parameters:
K- The type of keys used for the timers and the registry.
- All Known Implementing Classes:
BatchExecutionInternalTimeServiceManager,InternalTimeServiceManagerImpl
@Internal
public interface InternalTimeServiceManager<K>
An entity keeping all the time-related services.
NOTE: These services are only available to keyed operators.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA provider pattern for creating an instance of aInternalTimeServiceManager.static interfaceSignals whether the watermark should continue advancing. -
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceWatermark(Watermark watermark) Advances the Watermark of all managedtimer services, potentially firing event time timers.<N> InternalTimerService<N>getInternalTimerService(String name, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, Triggerable<K, N> triggerable) Creates anInternalTimerServicefor handling a group of timers identified by the givenname.voidsnapshotToRawKeyedState(KeyedStateCheckpointOutputStream stateCheckpointOutputStream, String operatorName) Snapshots the timers to raw keyed state.booleantryAdvanceWatermark(Watermark watermark, InternalTimeServiceManager.ShouldStopAdvancingFn shouldStopAdvancingFn) Try toadvanceWatermark(Watermark), but ifInternalTimeServiceManager.ShouldStopAdvancingFnreturnstrue, stop the advancement and return as soon as possible.
-
Method Details
-
getInternalTimerService
<N> InternalTimerService<N> getInternalTimerService(String name, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, Triggerable<K, N> triggerable) Creates anInternalTimerServicefor handling a group of timers identified by the givenname. The timers are scoped to a key and namespace.When a timer fires the given
Triggerablewill be invoked. -
advanceWatermark
Advances the Watermark of all managedtimer services, potentially firing event time timers.- Throws:
Exception
-
tryAdvanceWatermark
boolean tryAdvanceWatermark(Watermark watermark, InternalTimeServiceManager.ShouldStopAdvancingFn shouldStopAdvancingFn) throws Exception Try toadvanceWatermark(Watermark), but ifInternalTimeServiceManager.ShouldStopAdvancingFnreturnstrue, stop the advancement and return as soon as possible. -
snapshotToRawKeyedState
void snapshotToRawKeyedState(KeyedStateCheckpointOutputStream stateCheckpointOutputStream, String operatorName) throws Exception Snapshots the timers to raw keyed state.TODO: This can be removed once heap-based timers are integrated with RocksDB incremental snapshots.
- Throws:
Exception
-