[英]Flink: Window evaluation
I am using window(SlidingEventTimeWindows.of(Time.seconds(120), Time.seconds(1)))
sliding window for real_time streaming of data.我正在使用window(SlidingEventTimeWindows.of(Time.seconds(120), Time.seconds(1)))
滑动窗口进行实时数据流。 I am also using the interface AssignerWithPeriodicWatermarks
to extract the timestamps and assign watermarks.我还使用接口AssignerWithPeriodicWatermarks
来提取时间戳并分配水印。 I am applying the custom method apply()
on windowed stream.我正在窗口流上应用自定义方法apply()
。
In this scenario, what will trigger the window evaluation( apply()
execution), is it happened after every 1 sec.在这种情况下,什么会触发窗口评估( apply()
执行),它是在每 1 秒后发生一次。 which is equal to slide of window or is it after encountering the watermark in the stream?等于滑动窗口还是在遇到流中的水印后?
A window is evaluated when its end timestamp is smaller than the current watermark.当窗口的结束时间戳小于当前水印时,将评估窗口。 When a window operator receives a new watermarks, it checks all active windows and finalizes all windows whose end time is before the new watermark.当窗口操作符接收到一个新的水印时,它会检查所有活动的窗口并最终确定结束时间在新水印之前的所有窗口。
If you have a window that slides by 1 second and watermarks that arrive approximately every five seconds, each watermark will trigger the evaluation of five windows.如果您有一个滑动 1 秒的窗口,并且水印大约每 5 秒到达一次,则每个水印都会触发对五个窗口的评估。 You can think of the watermark as a mechanism to set the clock of the application.您可以将水印视为设置应用程序时钟的机制。 If the operator does not know that the clock advanced, it will not perform a computation.如果操作员不知道时钟提前,则不会执行计算。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.