Return-Path: X-Original-To: apmail-flink-dev-archive@www.apache.org Delivered-To: apmail-flink-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A3CAE1847D for ; Tue, 16 Jun 2015 14:08:53 +0000 (UTC) Received: (qmail 95537 invoked by uid 500); 16 Jun 2015 14:08:53 -0000 Delivered-To: apmail-flink-dev-archive@flink.apache.org Received: (qmail 95478 invoked by uid 500); 16 Jun 2015 14:08:53 -0000 Mailing-List: contact dev-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list dev@flink.apache.org Received: (qmail 95467 invoked by uid 99); 16 Jun 2015 14:08:53 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2015 14:08:53 +0000 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id BFD2C1A0503 for ; Tue, 16 Jun 2015 14:08:52 +0000 (UTC) Received: by wifx6 with SMTP id x6so20800669wif.0 for ; Tue, 16 Jun 2015 07:08:51 -0700 (PDT) X-Received: by 10.180.93.170 with SMTP id cv10mr7002169wib.44.1434463731574; Tue, 16 Jun 2015 07:08:51 -0700 (PDT) MIME-Version: 1.0 References: <55801173.4070205@informatik.hu-berlin.de> In-Reply-To: <55801173.4070205@informatik.hu-berlin.de> From: Aljoscha Krettek Date: Tue, 16 Jun 2015 14:08:41 +0000 Message-ID: Subject: Re: Question: SourceFunction To: dev@flink.apache.org Content-Type: multipart/alternative; boundary=f46d0438933129ed460518a31dae --f46d0438933129ed460518a31dae Content-Type: text/plain; charset=UTF-8 But the sources stay inside they run() method the whole execution time, per design. That's why another thread needs to call cancel() on the source to break it out of this (in most cases) infinite loop. On Tue, 16 Jun 2015 at 14:13 Matthias J. Sax wrote: > Hi, > > I just encountered, that the (new streaming API) SourceFunction > interface method cancel() states in the JavaDoc, that one might have a > "volatile field 'isRunning'". Why should this member be volatile? I do > not see why different thread should access this field (I would claim, it > will be implemented as a private/protected member variable), and thus, > declaring it volatile should not be necessary. > > Do I miss anything? > > -Matthias > > --f46d0438933129ed460518a31dae--