Class BatchExecutionInternalTimeService<K,N>
java.lang.Object
org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionInternalTimeService<K,N>
- All Implemented Interfaces:
InternalTimerService<N>
- Direct Known Subclasses:
BatchExecutionInternalTimeServiceWithAsyncState
public class BatchExecutionInternalTimeService<K,N>
extends Object
implements InternalTimerService<N>
An implementation of a
InternalTimerService that manages timers with a single active key
at a time. Can be used in a BATCH execution mode.-
Method Summary
Modifier and TypeMethodDescriptionlongReturns the current processing time.longReturns the current event-time watermark.voiddeleteEventTimeTimer(N namespace, long time) Deletes the timer for the given key and namespace.voiddeleteProcessingTimeTimer(N namespace, long time) Deletes the timer for the given key and namespace.voidforEachEventTimeTimer(org.apache.flink.util.function.BiConsumerWithException<N, Long, Exception> consumer) Performs an action for each registered timer.voidforEachProcessingTimeTimer(org.apache.flink.util.function.BiConsumerWithException<N, Long, Exception> consumer) Performs an action for each registered timer.voidregisterEventTimeTimer(N namespace, long time) Registers a timer to be fired when event time watermark passes the given time.voidregisterProcessingTimeTimer(N namespace, long time) Registers a timer to be fired when processing time passes the given time.voidsetCurrentKey(K currentKey)
-
Method Details
-
currentProcessingTime
public long currentProcessingTime()Description copied from interface:InternalTimerServiceReturns the current processing time.- Specified by:
currentProcessingTimein interfaceInternalTimerService<K>
-
currentWatermark
public long currentWatermark()Description copied from interface:InternalTimerServiceReturns the current event-time watermark.- Specified by:
currentWatermarkin interfaceInternalTimerService<K>
-
registerProcessingTimeTimer
Description copied from interface:InternalTimerServiceRegisters a timer to be fired when processing time passes the given time. The namespace you pass here will be provided when the timer fires.- Specified by:
registerProcessingTimeTimerin interfaceInternalTimerService<K>
-
registerEventTimeTimer
Description copied from interface:InternalTimerServiceRegisters a timer to be fired when event time watermark passes the given time. The namespace you pass here will be provided when the timer fires.- Specified by:
registerEventTimeTimerin interfaceInternalTimerService<K>
-
deleteProcessingTimeTimer
Description copied from interface:InternalTimerServiceDeletes the timer for the given key and namespace.- Specified by:
deleteProcessingTimeTimerin interfaceInternalTimerService<K>
-
deleteEventTimeTimer
Description copied from interface:InternalTimerServiceDeletes the timer for the given key and namespace.- Specified by:
deleteEventTimeTimerin interfaceInternalTimerService<K>
-
forEachEventTimeTimer
public void forEachEventTimeTimer(org.apache.flink.util.function.BiConsumerWithException<N, Long, Exception> consumer) Description copied from interface:InternalTimerServicePerforms an action for each registered timer. The timer service will set the key context for the timers key before invoking the action.- Specified by:
forEachEventTimeTimerin interfaceInternalTimerService<K>
-
forEachProcessingTimeTimer
public void forEachProcessingTimeTimer(org.apache.flink.util.function.BiConsumerWithException<N, Long, Exception> consumer) Description copied from interface:InternalTimerServicePerforms an action for each registered timer. The timer service will set the key context for the timers key before invoking the action.- Specified by:
forEachProcessingTimeTimerin interfaceInternalTimerService<K>
-
setCurrentKey
- Throws:
Exception
-