本文的Flink源码版本为: 1.15-SNAPSHOT,读者可自行从Github clone.
@PublicEvolving
public interface ProcessingTimeService {
// 返回当前的 processing time
long getCurrentProcessingTime();
/**
* Registers a task to be executed when (processing) time is {@code timestamp}.
*
* @param timestamp Time when the task is to be executed (in processing time)
* @param target The task to be executed
* @return The future that represents the scheduled task. This always returns some future, even
* if the timer was shut down
*/
// 注册定时器,并传入回调接口
// 当系统的 processing time 推进到 timestamp 时,会执行传入的 ProcessingTimeCallback 回调接口中定义的方法
Sched