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 Classes Modifier and Type Interface Description static interface
InternalTimeServiceManager.Provider
A provider pattern for creating an instance of aInternalTimeServiceManager
.static interface
InternalTimeServiceManager.ShouldStopAdvancingFn
Signals whether the watermark should continue advancing.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
advanceWatermark(Watermark watermark)
Advances the Watermark of all managedtimer services
, potentially firing event time timers.<N> InternalTimerService<N>
getAsyncInternalTimerService(String name, TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, Triggerable<K,N> triggerable, AsyncExecutionController<K> asyncExecutionController)
Creates anInternalTimerServiceAsyncImpl
for handling a group of timers identified by the givenname
.<N> InternalTimerService<N>
getInternalTimerService(String name, TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, Triggerable<K,N> triggerable)
Creates anInternalTimerService
for handling a group of timers identified by the givenname
.void
snapshotToRawKeyedState(KeyedStateCheckpointOutputStream stateCheckpointOutputStream, String operatorName)
Snapshots the timers to raw keyed state.boolean
tryAdvanceWatermark(Watermark watermark, InternalTimeServiceManager.ShouldStopAdvancingFn shouldStopAdvancingFn)
Try toadvanceWatermark(Watermark)
, but ifInternalTimeServiceManager.ShouldStopAdvancingFn
returnstrue
, stop the advancement and return as soon as possible.
-
-
-
Method Detail
-
getInternalTimerService
<N> InternalTimerService<N> getInternalTimerService(String name, TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, Triggerable<K,N> triggerable)
Creates anInternalTimerService
for handling a group of timers identified by the givenname
. The timers are scoped to a key and namespace.When a timer fires the given
Triggerable
will be invoked.
-
getAsyncInternalTimerService
<N> InternalTimerService<N> getAsyncInternalTimerService(String name, TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, Triggerable<K,N> triggerable, AsyncExecutionController<K> asyncExecutionController)
Creates anInternalTimerServiceAsyncImpl
for handling a group of timers identified by the givenname
. The timers are scoped to a key and namespace. Mainly used by async operators.Some essential order preservation will be added when the given
Triggerable
is invoked.
-
advanceWatermark
void advanceWatermark(Watermark watermark) throws Exception
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.ShouldStopAdvancingFn
returnstrue
, 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
-
-