Question about processElement(...) and onTimer(...) in ProcessFunction

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

Question about processElement(...) and onTimer(...) in ProcessFunction

Yassine MARZOUGUI
Hi all,

In ProcessFuction, does processElement() still get called on incoming elements when onTimer() is called, or are elements buffered until onTimer() returns?
I am wondering because both processElement() and onTimer() can access and manipulate the state, so if for example state.clear() is called at the end of onTimer() is there a risk that a state update by processElement() that happened during the onTimer() call get cleared? Thank you in advance.

Best,
Yassine
Reply | Threaded
Open this post in threaded view
|

Re: Question about processElement(...) and onTimer(...) in ProcessFunction

Fabian Hueske-2
Hi Yassine,

as far as I know, the processElement() and onTimer() methods are not concurrently called.
This is definitely true for event-time timers (they are triggered by watermarks which are internally handled as records) and I'm pretty sure that the behavior is the same for processing time timers.
@Kostas (in CC) please correct me if I'm wrong here.

Best, Fabian

2017-03-14 8:04 GMT+01:00 Yassine MARZOUGUI <[hidden email]>:
Hi all,

In ProcessFuction, does processElement() still get called on incoming elements when onTimer() is called, or are elements buffered until onTimer() returns?
I am wondering because both processElement() and onTimer() can access and manipulate the state, so if for example state.clear() is called at the end of onTimer() is there a risk that a state update by processElement() that happened during the onTimer() call get cleared? Thank you in advance.

Best,
Yassine

Reply | Threaded
Open this post in threaded view
|

Re: Question about processElement(...) and onTimer(...) in ProcessFunction

Yassine MARZOUGUI
Thank you Fabian for you answer.

Best,
Yassine

On Mar 14, 2017 09:31, "Fabian Hueske" <[hidden email]> wrote:
Hi Yassine,

as far as I know, the processElement() and onTimer() methods are not concurrently called.
This is definitely true for event-time timers (they are triggered by watermarks which are internally handled as records) and I'm pretty sure that the behavior is the same for processing time timers.
@Kostas (in CC) please correct me if I'm wrong here.

Best, Fabian

2017-03-14 8:04 GMT+01:00 Yassine MARZOUGUI <[hidden email]>:
Hi all,

In ProcessFuction, does processElement() still get called on incoming elements when onTimer() is called, or are elements buffered until onTimer() returns?
I am wondering because both processElement() and onTimer() can access and manipulate the state, so if for example state.clear() is called at the end of onTimer() is there a risk that a state update by processElement() that happened during the onTimer() call get cleared? Thank you in advance.

Best,
Yassine