flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aljoscha Krettek <aljos...@apache.org>
Subject Re: ConnectedStream keyby issues
Date Mon, 22 May 2017 12:14:23 GMT
Hi,

The State will never be automatically GC’ed. You have to do it in the onTimer() callback,
as mentioned earlier.

Best,
Aljoscha
> On 19. May 2017, at 10:39, gaurav <gaurav671989@gmail.com> wrote:
> 
> Hello 
> 
> I am little confused on when the state will be gc. For example,
> 
> Example 1:
> 
> Class abc extends RichProcessFunction<Tuple&lt;>,Tuple<>>
> {
>       public void processElement(......)
>       {
>           if(timer never set)
>           {
>                ctx.timerService().registerEventTimeTimer(...);
>           }
>       }
>       public void onTimer(.....)
>       {
>           // do some work ....
>           ctx.timerService().registerEventTimeTimer(...);
>       }
> }
> 
> In example 1, will it ever be garbage collected? Also, in example1 in
> processElement we are only once registering eventTimer. Will it be gc when
> the second event arrives?
> 
> And  if we have:
> Example 2
> public void onTimer(.....)
>       {
>           // do some work ....
>          // no timer registeration 
>       }
> Will it be gc after completion of onTimer ?  
> 
> 
> 
> 
> 
> --
> View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ConnectedStream-keyby-issues-tp12999p13219.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.


Mime
View raw message