flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chesnay Schepler <ches...@apache.org>
Subject Re: ProcessFunction collect and close, when to use?
Date Fri, 29 Nov 2019 10:43:01 GMT
1) You should never call close() on the collector; Flink will do that 
automatically.
2) No, it shouldn't block anything. Flink will look at the next record 
to process, notice it's a barrier and pass it on immediately.

On 29/11/2019 05:29, shuwen zhou wrote:
> Hi Community,
> In ProcessFunction class, ProcessElement function, there is a 
> Collector that has 2 method: collect() and close(). I would like to know:
>
> 1. When to call close() ? After every element processed? Or 
> on ProcessFunction.close() ? Or never to use it? If it's been closed 
> already, can the collector collect() anymore data?
> 2. If processElement received a message but consider it as discard and 
> does not call collect(), will this block checkpoint's barrier until 
> next element was sent by collect() ?
>
>
> -- 
> Best Wishes,
> Shuwen Zhou
>


Mime
View raw message