Return-Path: X-Original-To: apmail-flink-user-archive@minotaur.apache.org Delivered-To: apmail-flink-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6155A1798B for ; Thu, 16 Apr 2015 08:23:04 +0000 (UTC) Received: (qmail 26327 invoked by uid 500); 16 Apr 2015 08:23:04 -0000 Delivered-To: apmail-flink-user-archive@flink.apache.org Received: (qmail 26259 invoked by uid 500); 16 Apr 2015 08:23:04 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flink.apache.org Delivered-To: mailing list user@flink.apache.org Received: (qmail 26249 invoked by uid 99); 16 Apr 2015 08:23:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2015 08:23:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [74.125.82.44] (HELO mail-wg0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2015 08:22:58 +0000 Received: by wgsk9 with SMTP id k9so72155651wgs.3 for ; Thu, 16 Apr 2015 01:22:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=1FzcWF3DCG1ZQDSm8MEPRsc7x6J5/a57TUwX8MIBIR4=; b=TaMiN7xxYANCcTx89f29OXY7V3a62R8MuKcQzmmtdeC+6CGLNQWd0ASeKi2gDneSzF GfILxIKTQc7C+9X47gihu7kT+GRw8hIUQajC9g7ECwldQbizTgwnUz9gFu3hWQfrWOAC AXPeMiaU/2PBSM2GAVs76AIRBO3Evef9K/Tu9t21uU4zHiN4lhiDGjTiBSOlJg2+mkVr /TSxAX+zUgubc+ZJ5UOK5LvX1XwPWy4pEoCKt3cQ3icOKu0kzLPAGksWwkWqgcvj96Hz AzhLsspNkHlA+xlcw7hlnCcUKAWvBe7UU4kPdBz+kS5wtk7g0yS9eJRU3mzYyvCbjJJs 5Qvw== X-Gm-Message-State: ALoCoQm64DU3aeADP78RZWPxS5IJmR6wRyCw9gzLjwmGIoLYQ2Visi7z5SawQrbI8OXFYJIlWPDi X-Received: by 10.181.11.129 with SMTP id ei1mr2900958wid.57.1429172536601; Thu, 16 Apr 2015 01:22:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.27.32.9 with HTTP; Thu, 16 Apr 2015 01:21:56 -0700 (PDT) X-Originating-IP: [213.203.177.29] In-Reply-To: References: From: Flavio Pompermaier Date: Thu, 16 Apr 2015 10:21:56 +0200 Message-ID: Subject: Re: Concurrency on fields within operators To: user Content-Type: multipart/alternative; boundary=f46d043c81705e03510513d329e8 X-Virus-Checked: Checked by ClamAV on apache.org --f46d043c81705e03510513d329e8 Content-Type: text/plain; charset=UTF-8 Ok thanks a lot for the confirmation! Thread-safety within operators is absolutely helpful :) On Thu, Apr 16, 2015 at 9:20 AM, Robert Metzger wrote: > 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 > wrote: > >> Hi to all, >> I have a simple question: are transient fields inside a Rich-Function >> (like a RichMapPartition) thread-safe or not? >> >> Best, >> Flavio >> >> --f46d043c81705e03510513d329e8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Ok thanks a lot for the confirmation! Thread-safety within= operators is absolutely helpful :)

On Thu, Apr 16, 2015 at 9:20 AM, Robert Metzger <r= metzger@apache.org> wrote:
=
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 function= s concurrently (=3Dfrom multiple threads), so you don't need to worry a= bout 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, F= lavio Pompermaier <pompermaier@okkam.it> wrote:
Hi to all,
I have a simple qu= estion: are transient fields inside a Rich-Function =C2=A0(like a RichMapPa= rtition) thread-safe or not?

Best,
Fl= avio


--f46d043c81705e03510513d329e8--