You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by "G.S.Vijay Raajaa" <gs...@gmail.com> on 2017/10/04 19:50:18 UTC

Custom sliding window

Hi,

I would like to implement a custom time based sliding window . The idea is
that the window is of 1 hr size and slides every 5 second. I would like to
process the window function after 10 records are accumulated in the window
till it reaches 1 hr, post that since it slides every 5 second, the window
function will be called automatically. Any direction to implement the same
will be much appreciated?

Regards,
Vijay Raajaa G S

Re: Custom sliding window

Posted by Aljoscha Krettek <al...@apache.org>.
Hi,

I think you can implement that by writing a custom Trigger that combines functionality of CountTrigger and EventTimeTrigger. You should keep in mind, though, that having windows of size 1 hour and slide 5 seconds will lead to a lot of duplication because in Flink every sliding window is considered separate from the other windows. Meaning that with those settings each record will be put into 720 different sliding windows (there's 3600 seconds in one hour, divided by 5 yield 720).

Best,
Aljoscha

> On 4. Oct 2017, at 21:50, G.S.Vijay Raajaa <gs...@gmail.com> wrote:
> 
> Hi,
> 
> I would like to implement a custom time based sliding window . The idea is that the window is of 1 hr size and slides every 5 second. I would like to process the window function after 10 records are accumulated in the window till it reaches 1 hr, post that since it slides every 5 second, the window function will be called automatically. Any direction to implement the same will be much appreciated?
> 
> Regards,
> Vijay Raajaa G S