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

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

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

Swapnil Chougule
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
Reply | Threaded
Open this post in threaded view
|

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

Swapnil Chougule
Can I get any update please ?

Regards,
Swapnil
Reply | Threaded
Open this post in threaded view
|

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

Stefan Richter
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 <[hidden email]>:
>
> Can I get any update please ?
>
> Regards,
> Swapnil

Reply | Threaded
Open this post in threaded view
|

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

Aljoscha Krettek
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 <[hidden email]> 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 <[hidden email]>:
>
> Can I get any update please ?
>
> Regards,
> Swapnil