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 8FC8C17866 for ; Wed, 23 Sep 2015 07:03:28 +0000 (UTC) Received: (qmail 1449 invoked by uid 500); 23 Sep 2015 07:03:28 -0000 Delivered-To: apmail-apex-dev-archive@apex.apache.org Received: (qmail 1383 invoked by uid 500); 23 Sep 2015 07:03:28 -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 1366 invoked by uid 99); 23 Sep 2015 07:03:28 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2015 07:03:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id BEEA718098A for ; Wed, 23 Sep 2015 07:03:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.98 X-Spam-Level: ** X-Spam-Status: No, score=2.98 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Fmhmir6NYymp for ; Wed, 23 Sep 2015 07:03:22 +0000 (UTC) Received: from mail-qk0-f179.google.com (mail-qk0-f179.google.com [209.85.220.179]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id D3DE542AB6 for ; Wed, 23 Sep 2015 07:03:21 +0000 (UTC) Received: by qkdw123 with SMTP id w123so13878355qkd.0 for ; Wed, 23 Sep 2015 00:03:21 -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=aFYJwznYMRWoFpLutTpU3sVSw0SW7S97dDo1JWaJ1i4=; b=ITihkgs6Yy3hRc6Lc9LBLvlMGcDXDkawxO7f92Y7ZC6MP+zkrvRHI/Dc99QMv3ATXF jOLOEluIeBl+EkDKFvYUeYJQLeji7icXAnw1mclOjhYerR5EzcYYhIiaZMMq9SVjf8Y4 zYXZDzoYuv+LincZpgrOx6kdLA242OWRj//LZh6eoqk3jZwo+71cqirEIZOEYg++3wK5 TPajxYqJrg4o9+DoXbFmENDC1xQpwIiPa7+kO0+ALWqff3gUT4PBWAMJwrAH06x8qhEu BoG5R+4uWJPI4xuJcmMqvtumTzEpLRM4DLIDztl3qcSm1yN4NS3wrxFr9+P5SXnv6bav 1J4A== X-Gm-Message-State: ALoCoQn+o5NuesFTVf2G0Y0FwVYbE9B+MwoO8sxrVAkScNuakXv6Ee+WeoMGNjzCDRmuzhLb429S X-Received: by 10.55.40.18 with SMTP id o18mr34160135qkh.41.1442991801528; Wed, 23 Sep 2015 00:03:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.23.197 with HTTP; Wed, 23 Sep 2015 00:02:52 -0700 (PDT) In-Reply-To: References: From: Pramod Immaneni Date: Wed, 23 Sep 2015 00:02:52 -0700 Message-ID: Subject: Re: Assign property to partition instances of Operator To: dev@apex.incubator.apache.org Content-Type: multipart/alternative; boundary=001a11440fb8be8cd4052064b54f --001a11440fb8be8cd4052064b54f Content-Type: text/plain; charset=UTF-8 Yes two ways separate operator or repartition. On Tue, Sep 22, 2015 at 11:58 PM, Gaurav Gupta wrote: > Pramod , > > That is what I was thinking that Operator requests can also be received in > different windows...Looks like adding another operator is safe solution > > Thanks > -Gaurav > > On Tue, Sep 22, 2015 at 11:43 PM, Pramod Immaneni > wrote: > > > The operator request would also be received in different windows. > > > > On Tue, Sep 22, 2015 at 11:34 PM, Priyanka Gugale < > > priyanka@datatorrent.com> > > wrote: > > > > > Promod, > > > > > > You are right about applying the value in same window. And yes I don't > > want > > > to change number of partitions or even redeploy any partition for this. > > > I need to explore on Chandini's suggestion of using StatsListener. > > > > > > -Priyanka > > > > > > On Wed, Sep 23, 2015 at 12:00 PM, Pramod Immaneni < > > pramod@datatorrent.com> > > > wrote: > > > > > > > I am not sure about priyanka's requirements but typically you would > > want > > > to > > > > apply the value in the same window for all partitions for consistency > > > with > > > > the calculations. This could be done two ways using a separate > logical > > > > operator feeding the value to all partitions so that the value > appears > > in > > > > the same window or repartitioning the existing set and setting the > > value > > > > during repartitioning. In the latter case you are just repartitioning > > so > > > > that the partitions start from same point with the new value and not > to > > > > change the number of partitions. > > > > > > > > Thanks > > > > > > > > On Tue, Sep 22, 2015 at 11:18 PM, Chandni Singh < > > chandni@datatorrent.com > > > > > > > > wrote: > > > > > > > > > Pramod, > > > > > > > > > > Tim's discussion was about setting a property on multiple operators > > > > > (different logical operators). > > > > > Priyanka's question is about different partitions of an operator > > > > > > > > > > Let's say they are 5 partitions of an operator and we need to > change > > an > > > > int > > > > > property. There are following ways: > > > > > > > > > > 1. Divide the int property by 5 and issue set-physical operator > > > property > > > > > command for each partition. This is manual. > > > > > > > > > > 2. Set the logical operator property but wait till partition > happens. > > > > This > > > > > will require partitioning to be triggered for which a StatsListener > > > needs > > > > > to be implemented. So if partitioning never happens this will never > > be > > > > > triggered. Also un-deploying and deploying a partition just to > > change a > > > > > property on the physical partition seems un-necessary > > > > > > > > > > 3. Implementing StatsListener to send operator request and not > > > > re-partition > > > > > seems to be appropriate way. > > > > > > > > > > Chandni > > > > > > > > > > On Tue, Sep 22, 2015 at 11:02 PM, Pramod Immaneni < > > > > pramod@datatorrent.com> > > > > > wrote: > > > > > > > > > > > Priyanka you want to divide the value among existing partitions > > right > > > > and > > > > > > not necessarily change the number of partitions. To this end > Ashwin > > > is > > > > > > suggesting makes sense. However different partitions can be at > > > > different > > > > > > windows and will see the value change in different windows. You > > need > > > a > > > > > > separate operator to receive this change and propagate it to the > > > > > partitions > > > > > > via data flow. Tim discussed this over the last weekend in a > series > > > of > > > > > > emails. > > > > > > > > > > > > Thanks > > > > > > > > > > > > On Tue, Sep 22, 2015 at 10:43 PM, Priyanka Gugale < > > > > > > priyanka@datatorrent.com> > > > > > > wrote: > > > > > > > > > > > > > Thanks for suggestions. > > > > > > > > > > > > > > Ashwin, The option you proposed is doable, but then each > operator > > > > which > > > > > > > needs to address such use case will have to track the number of > > > > > > partitions. > > > > > > > So we were looking for some common mechanism. > > > > > > > Chandni, Let me try the res.operatorRequests, that could solve > > the > > > > > > problem. > > > > > > > > > > > > > > -Priyanka > > > > > > > > > > > > > > On Tue, Sep 22, 2015 at 8:05 PM, Chandni Singh < > > > > > chandni@datatorrent.com> > > > > > > > wrote: > > > > > > > > > > > > > > > Hi Priyanka, > > > > > > > > > > > > > > > > As Isha mentioned you will can implement a StatsListener. > > However > > > > > > instead > > > > > > > > of setting res.repartitionRequired = true, you can add a > > > > > > > > StatsListener.OperatorRequest to res.operatorsRequests. This > > will > > > > not > > > > > > > > re-deploy the instances. > > > > > > > > > > > > > > > > The OperatorRequest that you will need to implement will have > > to > > > > > change > > > > > > > the > > > > > > > > property value. > > > > > > > > > > > > > > > > You can refer to AutoMetricTest for an example. > > > > > > > > > > > > > > > > - Chandni > > > > > > > > > > > > > > > > On Tue, Sep 22, 2015 at 7:11 AM, Ashwin Chandra Putta < > > > > > > > > ashwinchandrap@gmail.com> wrote: > > > > > > > > > > > > > > > > > Why not maintain a variable containing the number of > > partitions > > > > in > > > > > > each > > > > > > > > > partition; and when you set the property, just divide it by > > > > number > > > > > of > > > > > > > > > partitions variable? Does it not solve the problem? > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > Ashwin. > > > > > > > > > > > > > > > > > > On Tue, Sep 22, 2015 at 5:37 AM, Priyanka Gugale < > > > > > > > > priyanka@datatorrent.com > > > > > > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > I have an integer property named "intProp". This property > > is > > > > > > > applicable > > > > > > > > > to > > > > > > > > > > an operator A. I can set the property from dtcli using > > > > > > > > > > "set-operator-property operator-name property-name > > > > > property-value" > > > > > > > and > > > > > > > > > this > > > > > > > > > > will get applied to all instances of opeartor A. > > > > > > > > > > > > > > > > > > > > Now, I want to apply this property in a way that it's > > equally > > > > > > divided > > > > > > > > > > amongst all instances of operator A. For example, if > > > > intProp=100 > > > > > > and > > > > > > > > > > number of partitions=4 then intProp=25 should be set on > > each > > > > > > instance > > > > > > > > of > > > > > > > > > > operator A. > > > > > > > > > > > > > > > > > > > > Is there a way to achieve this? > > > > > > > > > > > > > > > > > > > > I have tried following approach to do this: I have > > overriden > > > > > > > > > > definePartitions of Operator, once we do partitioning I > am > > > > > setting > > > > > > > > right > > > > > > > > > > value on each operator instance based on new partition > > count. > > > > The > > > > > > > > > > limitation here is that the value is applied during > > > > > > definePartitions. > > > > > > > > If > > > > > > > > > > the value is updated dynamically it won't be applied till > > > > > > > > > definePartitions > > > > > > > > > > is called again. > > > > > > > > > > > > > > > > > > > > -Priyanka > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > Ashwin. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --001a11440fb8be8cd4052064b54f--