You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Swapnil Chougule <th...@gmail.com> on 2016/09/22 17:19:09 UTC

Rich Window Function - When does close(tear down) method executes ?

I am using rich window function in my streaming project. I want "close"
method to get triggered after each window interval.
In my case, open gets executed life time once & close method doesn't get
executed ?

Can anybody help to sort out same ? I want tear down method after each
window interval.

Thanks,
Swapnil

Re: Rich Window Function - When does close(tear down) method executes ?

Posted by Aljoscha Krettek <al...@apache.org>.
Hi Swapnil,
you can just have all your logic in the apply() method of your
WindowFunction. This is called once the window fires so any code that you
put at the end there will be executed effectively after each window firing.

Cheers,
Aljoscha

On Fri, 23 Sep 2016 at 10:51 Stefan Richter <s....@data-artisans.com>
wrote:

> Hi,
>
> from the documentation of close(), the method is only called once at the
> end of the lifecycle of a user function:
>
> „Tear-down method for the user code. It is called after the last call to
> the main working methods (e.g. map or join).“
>
> If you want to perform tasks whenever a window triggers, you should use a
> trigger for that.
>
> Best,
> Stefan
>
> > Am 23.09.2016 um 08:43 schrieb Swapnil Chougule <the.swapnil09@gmail.com
> >:
> >
> > Can I get any update please ?
> >
> > Regards,
> > Swapnil
>
>

Re: Rich Window Function - When does close(tear down) method executes ?

Posted by Stefan Richter <s....@data-artisans.com>.
Hi,

from the documentation of close(), the method is only called once at the end of the lifecycle of a user function:

„Tear-down method for the user code. It is called after the last call to the main working methods (e.g. map or join).“

If you want to perform tasks whenever a window triggers, you should use a trigger for that.

Best,
Stefan

> Am 23.09.2016 um 08:43 schrieb Swapnil Chougule <th...@gmail.com>:
> 
> Can I get any update please ?
> 
> Regards,
> Swapnil


Re: Rich Window Function - When does close(tear down) method executes ?

Posted by Swapnil Chougule <th...@gmail.com>.
Can I get any update please ?

Regards,
Swapnil