Custom sliding window

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom sliding window

G.S.Vijay Raajaa
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
Reply | Threaded
Open this post in threaded view
|

Re: Custom sliding window

Aljoscha Krettek
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 <[hidden email]> 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