flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Metzger <rmetz...@apache.org>
Subject Re: Concurrency on fields within operators
Date Thu, 16 Apr 2015 07:20:49 GMT
Hi Flavio,

tl;dr: they are thread safe.

making a field transient means that it is ignored when serializing the
class. This is for example useful when you have a non-serializable field in
your function (you have to initialize it in the open() method then).
So making it transient or not doesn't change the fields thread safety.
Flink doesn't call the user defined functions concurrently (=from multiple
threads), so you don't need to worry about thread safety.
The only case you need to worry about thread safety in your (Rich-)Function
is when you're starting threads yourself inside the Function.

On Thu, Apr 16, 2015 at 9:09 AM, Flavio Pompermaier <pompermaier@okkam.it>

> Hi to all,
> I have a simple question: are transient fields inside a Rich-Function
>  (like a RichMapPartition) thread-safe or not?
> Best,
> Flavio

View raw message