Interface ProcessingTimeService
-
- All Superinterfaces:
org.apache.flink.api.common.operators.ProcessingTimeService
- All Known Subinterfaces:
TimerService
- All Known Implementing Classes:
SystemProcessingTimeService
public interface ProcessingTimeService extends org.apache.flink.api.common.operators.ProcessingTimeService
Defines the current processing time and handles all related actions, such as register timers for tasks to be executed in the future.The access to the time via
getCurrentProcessingTime()
is always available, regardless of whether the timer service has been shut down.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.apache.flink.util.clock.Clock
getClock()
ReturnsClock
associated with this timer service.default long
getCurrentProcessingTime()
CompletableFuture<Void>
quiesce()
This method puts the service into a state where it does not register new timers, but returns for each call toProcessingTimeService.registerTimer(long, org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback)
orscheduleAtFixedRate(org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback, long, long)
a "mock" future and the "mock" future will be never completed.ScheduledFuture<?>
scheduleAtFixedRate(org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback callback, long initialDelay, long period)
Registers a task to be executed repeatedly at a fixed rate.ScheduledFuture<?>
scheduleWithFixedDelay(org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback callback, long initialDelay, long period)
Registers a task to be executed repeatedly with a fixed delay.
-
-
-
Method Detail
-
getCurrentProcessingTime
default long getCurrentProcessingTime()
- Specified by:
getCurrentProcessingTime
in interfaceorg.apache.flink.api.common.operators.ProcessingTimeService
-
getClock
org.apache.flink.util.clock.Clock getClock()
ReturnsClock
associated with this timer service.
-
scheduleAtFixedRate
ScheduledFuture<?> scheduleAtFixedRate(org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback callback, long initialDelay, long period)
Registers a task to be executed repeatedly at a fixed rate.This call behaves similar to
ScheduledExecutor.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
.- Parameters:
callback
- to be executed after the initial delay and then after each periodinitialDelay
- initial delay to start executing callbackperiod
- after the initial delay after which the callback is executed- Returns:
- Scheduled future representing the task to be executed repeatedly
-
scheduleWithFixedDelay
ScheduledFuture<?> scheduleWithFixedDelay(org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback callback, long initialDelay, long period)
Registers a task to be executed repeatedly with a fixed delay.This call behaves similar to
ScheduledExecutor.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
.- Parameters:
callback
- to be executed after the initial delay and then after each periodinitialDelay
- initial delay to start executing callbackperiod
- after the initial delay after which the callback is executed- Returns:
- Scheduled future representing the task to be executed repeatedly
-
quiesce
CompletableFuture<Void> quiesce()
This method puts the service into a state where it does not register new timers, but returns for each call toProcessingTimeService.registerTimer(long, org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback)
orscheduleAtFixedRate(org.apache.flink.api.common.operators.ProcessingTimeService.ProcessingTimeCallback, long, long)
a "mock" future and the "mock" future will be never completed. Furthermore, the timers registered before are prevented from firing, but the timers in running are allowed to finish.If no timer is running, the quiesce-completed future is immediately completed and returned. Otherwise, the future returned will be completed when all running timers have finished.
-
-