public interface ProcessingTimeService
The access to the time via getCurrentProcessingTime()
is always available, regardless of
whether the timer service has been shut down.
限定符和类型 | 方法和说明 |
---|---|
long |
getCurrentProcessingTime()
Returns the current processing time.
|
CompletableFuture<Void> |
quiesce()
This method puts the service into a state where it does not register new timers, but
returns for each call to
registerTimer(long, org.apache.flink.streaming.runtime.tasks.ProcessingTimeCallback) or scheduleAtFixedRate(org.apache.flink.streaming.runtime.tasks.ProcessingTimeCallback, long, long) a "mock"
future and the "mock" future will be never completed. |
ScheduledFuture<?> |
registerTimer(long timestamp,
ProcessingTimeCallback target)
Registers a task to be executed when (processing) time is
timestamp . |
ScheduledFuture<?> |
scheduleAtFixedRate(ProcessingTimeCallback callback,
long initialDelay,
long period)
Registers a task to be executed repeatedly at a fixed rate.
|
ScheduledFuture<?> |
scheduleWithFixedDelay(ProcessingTimeCallback callback,
long initialDelay,
long period)
Registers a task to be executed repeatedly with a fixed delay.
|
long getCurrentProcessingTime()
ScheduledFuture<?> registerTimer(long timestamp, ProcessingTimeCallback target)
timestamp
.timestamp
- Time when the task is to be executed (in processing time)target
- The task to be executedScheduledFuture<?> scheduleAtFixedRate(ProcessingTimeCallback callback, long initialDelay, long period)
This call behaves similar to
ScheduledExecutor.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
.
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 executedScheduledFuture<?> scheduleWithFixedDelay(ProcessingTimeCallback callback, long initialDelay, long period)
This call behaves similar to
ScheduledExecutor.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
.
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 executedCompletableFuture<Void> quiesce()
registerTimer(long, org.apache.flink.streaming.runtime.tasks.ProcessingTimeCallback)
or scheduleAtFixedRate(org.apache.flink.streaming.runtime.tasks.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.
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.