public class BatchExecutionInternalTimeServiceManager<K> extends Object implements InternalTimeServiceManager<K>, KeyedStateBackend.KeySelectionListener<K>
InternalTimeServiceManager
that manages timers with a single
active key at a time. Can be used in a BATCH execution mode.InternalTimeServiceManager.Provider
Constructor and Description |
---|
BatchExecutionInternalTimeServiceManager(ProcessingTimeService processingTimeService) |
Modifier and Type | Method and Description |
---|---|
void |
advanceWatermark(Watermark watermark)
Advances the Watermark of all managed
timer services ,
potentially firing event time timers. |
static <K> InternalTimeServiceManager<K> |
create(CheckpointableKeyedStateBackend<K> keyedStatedBackend,
ClassLoader userClassloader,
KeyContext keyContext,
ProcessingTimeService processingTimeService,
Iterable<KeyGroupStatePartitionStreamProvider> rawKeyedStates) |
<N> InternalTimerService<N> |
getInternalTimerService(String name,
TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
Triggerable<K,N> triggerable)
Creates an
InternalTimerService for handling a group of timers identified by the
given name . |
void |
keySelected(K newKey)
Callback when key context is switched.
|
void |
snapshotToRawKeyedState(KeyedStateCheckpointOutputStream context,
String operatorName)
Snapshots the timers to raw keyed state.
|
public BatchExecutionInternalTimeServiceManager(ProcessingTimeService processingTimeService)
public <N> InternalTimerService<N> getInternalTimerService(String name, TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, Triggerable<K,N> triggerable)
InternalTimeServiceManager
InternalTimerService
for handling a group of timers identified by the
given name
. The timers are scoped to a key and namespace.
When a timer fires the given Triggerable
will be invoked.
getInternalTimerService
in interface InternalTimeServiceManager<K>
public void advanceWatermark(Watermark watermark)
InternalTimeServiceManager
timer services
,
potentially firing event time timers.advanceWatermark
in interface InternalTimeServiceManager<K>
public void snapshotToRawKeyedState(KeyedStateCheckpointOutputStream context, String operatorName) throws Exception
InternalTimeServiceManager
TODO: This can be removed once heap-based timers are integrated with RocksDB incremental snapshots.
snapshotToRawKeyedState
in interface InternalTimeServiceManager<K>
Exception
public static <K> InternalTimeServiceManager<K> create(CheckpointableKeyedStateBackend<K> keyedStatedBackend, ClassLoader userClassloader, KeyContext keyContext, ProcessingTimeService processingTimeService, Iterable<KeyGroupStatePartitionStreamProvider> rawKeyedStates)
public void keySelected(K newKey)
KeyedStateBackend.KeySelectionListener
keySelected
in interface KeyedStateBackend.KeySelectionListener<K>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.