Interface InternalTimerService<N>
- Type Parameters:
N- Type of the namespace to which timers are scoped.
- All Known Implementing Classes:
BatchExecutionInternalTimeService,BatchExecutionInternalTimeServiceWithAsyncState,InternalTimerServiceAsyncImpl,InternalTimerServiceImpl
@Internal
public interface InternalTimerService<N>
Interface for working with time and timers.
This is the internal version of TimerService that
allows to specify a key and a namespace to which timers should be scoped.
-
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.
-
Method Details
-
currentProcessingTime
long currentProcessingTime()Returns the current processing time. -
currentWatermark
long currentWatermark()Returns the current event-time watermark. -
registerProcessingTimeTimer
Registers a timer to be fired when processing time passes the given time. The namespace you pass here will be provided when the timer fires. -
deleteProcessingTimeTimer
Deletes the timer for the given key and namespace. -
registerEventTimeTimer
Registers 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. -
deleteEventTimeTimer
Deletes the timer for the given key and namespace. -
forEachEventTimeTimer
void forEachEventTimeTimer(org.apache.flink.util.function.BiConsumerWithException<N, Long, throws ExceptionException> consumer) Performs an action for each registered timer. The timer service will set the key context for the timers key before invoking the action.- Throws:
Exception
-
forEachProcessingTimeTimer
void forEachProcessingTimeTimer(org.apache.flink.util.function.BiConsumerWithException<N, Long, throws ExceptionException> consumer) Performs an action for each registered timer. The timer service will set the key context for the timers key before invoking the action.- Throws:
Exception
-