Return-Path: X-Original-To: apmail-apex-dev-archive@minotaur.apache.org Delivered-To: apmail-apex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 91714187AF for ; Mon, 9 Nov 2015 08:27:57 +0000 (UTC) Received: (qmail 46265 invoked by uid 500); 9 Nov 2015 08:27:57 -0000 Delivered-To: apmail-apex-dev-archive@apex.apache.org Received: (qmail 46199 invoked by uid 500); 9 Nov 2015 08:27:57 -0000 Mailing-List: contact dev-help@apex.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.incubator.apache.org Delivered-To: mailing list dev@apex.incubator.apache.org Received: (qmail 46184 invoked by uid 99); 9 Nov 2015 08:27:57 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2015 08:27:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B9C82C09FA for ; Mon, 9 Nov 2015 08:27:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.001 X-Spam-Level: *** X-Spam-Status: No, score=3.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=3, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=datatorrent_com.20150623.gappssmtp.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id K63yq1pbHvfI for ; Mon, 9 Nov 2015 08:27:46 +0000 (UTC) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 73ED420C18 for ; Mon, 9 Nov 2015 08:27:45 +0000 (UTC) Received: by pabfh17 with SMTP id fh17so192279855pab.0 for ; Mon, 09 Nov 2015 00:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datatorrent_com.20150623.gappssmtp.com; s=20150623; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=eKY9zBXZiF0e4p/KBrcDBfjDvQP0wk6r3ZJocx6SOgg=; b=WUnyvfUC7PEbfHSyP7iWhBJ6dpljw3MtHEQMENrSYZDl/VGOXjqMJf8i4vCx1/vcyg or+/htQ3E6MdiTa90EVU7StHZsIjuZKKBdWJfST9aXQUpUFzHiTy3WLxPrR4BgyC+Klt F1k61knhy0aOZUUw6crj586i2eU/KerC4P1+Y/dKz7z3NOeuET8JJdEBxQ636iglHVgd 48cbJmQNgMqmjOWc9ucSiN4q3owhg9eIpJjDOHnO727cLnWtI/hdwQ+6tBLXHdl2YK0p ISMFoNXyoJn6xpOvXHgUhqTjBGrybE5FHYpoWLMuSLVYG5c09NLXK0nCiuCzC7reetjh kYTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:message-id:mime-version :subject:date:references:to:in-reply-to; bh=eKY9zBXZiF0e4p/KBrcDBfjDvQP0wk6r3ZJocx6SOgg=; b=lrfK11S9PFdHTbKtegfq2ml2SEf5W6hAxdeUhJ0GpveBH9uDqF/GJvtPS5f0DfON10 LXThtVLv5YTmTroVEtQiGCvcuJ3lFXzA1aoLW9wuBcUL0UW1YR7l6mRcX/YrBdNncXam POLr+IizGghZXNCTi9/wyFtVBcV5AuJURA9t6ajayFlgmwmZvKZaJTmPp8Q7xSWp6R2y HGHqw9xnf2pnQlhdHUSp4prxky0RVxjGsd4eOghSffoVEONDro1npzI4tCjsjWaEW4hs yYovjLST3XBQ1V+KGjEo2PA1YDu1ZEy+Bo4cLYZ5+ypX8woba8wwbXln/yxf65cEDTg+ hMbg== X-Gm-Message-State: ALoCoQmN0TxSUJ4C1djgTIitGs3eBUlfDdwPKyRfQYwXGngHO5Br9Fc65rSyzaGKlvpt1XfFwQ65 X-Received: by 10.68.137.36 with SMTP id qf4mr38019851pbb.11.1447057657811; Mon, 09 Nov 2015 00:27:37 -0800 (PST) Received: from [192.168.1.2] ([122.173.180.56]) by smtp.gmail.com with ESMTPSA id tp6sm14728560pbc.81.2015.11.09.00.27.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Nov 2015 00:27:37 -0800 (PST) From: Gaurav Gupta Content-Type: multipart/alternative; boundary="Apple-Mail=_A7870865-0D08-4E30-99ED-3416EF5ED5A1" Message-Id: <6D68F8A7-2150-42D3-A9DA-72453AD8B57F@datatorrent.com> Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) Subject: Re: Managing state within an application window Date: Mon, 9 Nov 2015 00:27:32 -0800 References: To: dev@apex.incubator.apache.org In-Reply-To: X-Mailer: Apple Mail (2.3094) --Apple-Mail=_A7870865-0D08-4E30-99ED-3416EF5ED5A1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Bhupesh, Platform supports sliding window feature natively. You can refer to = SLIDE_BY_WINDOW_COUNT attribute = (https://github.com/apache/incubator-apex-core/blob/master/api/src/main/ja= va/com/datatorrent/api/Context.java = ) and you can also look at = SliderTest = https://github.com/apache/incubator-apex-core/blob/master/engine/src/test/= java/com/datatorrent/stram/engine/SliderTest.java Thanks - Gaurav > On Nov 9, 2015, at 12:00 AM, Bhupesh Chawda = wrote: >=20 > Yes, it will be reset in the endWindow call. So nothing should be = needed to > be done explicitly. > Also, after the crash, the operator is restored to the checkpoint = which had > happened after beginWindow but before endWindow. In this case the > beginWindow() call will be skipped when the operator restarts after > recovery. > It is easy to wrongly assume (which I did) that checkpoints always = happen > "after endWindow" (in which case, the variable can be made transient). >=20 > I also had a concern regarding *sliding application windows*. It is = not > clear as to how the beginWindow and endWindow calls would be = structured. In > addition to the application window size, we would also need some = *delta* > which is the amount by which the window would "slide" by. How is this > specified? Is this per tuple? Also how would checkpointing and = recovery act > in such a case? >=20 > Thanks. > Bhupesh >=20 > On Mon, Nov 9, 2015 at 12:39 PM, Milind Barve = wrote: >=20 >> You might want to initialize it in beginwidow() as well. Should keep = it non >> transient so for recovery. >> On Nov 9, 2015 12:34 PM, "Amol Kekre" wrote: >>=20 >>> Bhupesh. >>> I would recommend reseting the variable in endWindow call and = leaving it >>> non-transient. Usually an empty variable should not add too much to >>> serialization. >>>=20 >>> Thks, >>> Amol >>>=20 >>>=20 >>> On Sun, Nov 8, 2015 at 10:57 PM, Bhupesh Chawda = >>=20 >>> wrote: >>>=20 >>>> Hi All, >>>>=20 >>>> I have a question regarding maintaining state of a variable within = a >>> single >>>> application window. >>>> If I have a variable which is just needed for a single application >> window >>>> (just between beginWindow and endWindow calls), do I need to = serialize >>> and >>>> checkpoint it? or can I make it transient? >>>>=20 >>>> I understand that in case of checkpoint windows being aligned with = the >>>> application windows, we can do so. Since in this case, the variable >> will >>>> start afresh immediately after the checkpoint. However in case of >>>> checkpoints happening in between application windows, this might = not be >>> the >>>> case. >>>>=20 >>>> In the second case, is there any mechanism using which I can >>> conditionally >>>> make it transient and non-transient based on when the checkpoints >> happen >>>> with respect to the application windows? >>>>=20 >>>> Thanks. >>>> Bhupesh >>>>=20 >>>=20 >>=20 --Apple-Mail=_A7870865-0D08-4E30-99ED-3416EF5ED5A1--