You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by "wanglei2@geekplus.com.cn" <wa...@geekplus.com.cn> on 2019/06/14 10:08:06 UTC

How to trigger the window function even there's no message input in this window?

windowAll(TumblingProcessingTimeWindows.of(Time.seconds(10))).process(new MyProcessWindowFunction());How can i trigger the MyProcessWindowFunction even there's no input during this window time? 



wanglei2@geekplus.com.cn


Re: How to trigger the window function even there's no message input in this window?

Posted by Piotr Nowojski <pi...@ververica.com>.
Hi,

As far as I know, this is currently impossible.

You can workaround this issue by maybe implementing your own custom post processing operator/flatMap function, that would:
- track the output of window operator
- register processing time timer with some desired timeout
- every time the processing time timer fires, your code would check if window operator has emitted something in the last X seconds period. If not, it could emit some default element

Piotrek

> On 14 Jun 2019, at 12:08, wanglei2@geekplus.com.cn wrote:
> 
> 
> windowAll(TumblingProcessingTimeWindows.of(Time.seconds(10))).process(new MyProcessWindowFunction());
> How can i trigger the MyProcessWindowFunction even there's no input during this window time? 
> 
> wanglei2@geekplus.com.cn <ma...@geekplus.com.cn>