Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 101A3200BA0 for ; Fri, 30 Sep 2016 01:29:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0E7FB160AE4; Thu, 29 Sep 2016 23:29:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4E78C160AE3 for ; Fri, 30 Sep 2016 01:29:56 +0200 (CEST) Received: (qmail 16040 invoked by uid 500); 29 Sep 2016 23:29:55 -0000 Mailing-List: contact dev-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.apache.org Delivered-To: mailing list dev@apex.apache.org Received: (qmail 16028 invoked by uid 99); 29 Sep 2016 23:29:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2016 23:29:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9831F1A136D for ; Thu, 29 Sep 2016 23:29:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.479 X-Spam-Level: ** X-Spam-Status: No, score=2.479 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=datatorrent-com.20150623.gappssmtp.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 6dvdu5rO2bem for ; Thu, 29 Sep 2016 23:29:52 +0000 (UTC) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 42CFC5FBDB for ; Thu, 29 Sep 2016 23:29:52 +0000 (UTC) Received: by mail-it0-f41.google.com with SMTP id u134so14568151itb.1 for ; Thu, 29 Sep 2016 16:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datatorrent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=YNIowpVe0pK0z3O2i9d/tX4PymXLQPxBA/h6AE8yS9I=; b=cGhCskga9t7tpC3enWTuD0jzXc431KuOxOHBjBEBsWOS9KZ+tz6E7yKHMcUeDqrwi7 5itiT9329+zhZtI1rErdKDvZMkSdm4+L9z3fzNevNuvhe/HsRU4pTK+I/B5sZ7Rb7uzR zXHlIlOQ/ihTBYloCckDHLnfm/rPd9hTsQd8I3bDC/nSqfSASLMhGkbR2JcT+2ny0U2x Tyx6uAzS7vu8uxKm9zQ5gjlWdqkLTDT89ibTq22ZLbUgleu/gzf2toLhMDWpua8piWLp n6KwkXAJrVKg2rspq+r3pVFLg5LcBJXpJxjU8UoUVFAN7Y+RGs59O1/LxJKY10YfpPSe LnVA== 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; bh=YNIowpVe0pK0z3O2i9d/tX4PymXLQPxBA/h6AE8yS9I=; b=erGshAOO0PZQgKW0ksfkubBN8LeDe1bg05woJ45CK5iy37RPKaJrhj+v+wbesIaHDu qpQ8/RzUM55ZlFAGqTtpjGw3PyxDsQSkfjNVDQqM3r05W8bmXP46VdbtfYlUf6JrVxqP ZuXUGQyyW21gh4EKlS2Dhu4YKDQ6x4fZgYltY4h5OGLkfVhWbP/h/EEe7bxoQ0QcgGJs BLOeprf8Ojzbjn7zumuwHt8ti5QbJNc3ReCo2elEf5xSsr+BN92zbdVzuWw3KYZlqpYo V/AZH9M1zRI8Q87mPmDXlRZzZfTTZX8ZZxpb3rd+eVltgXAIzQqk/c6FF6CLLxoUAuxv u+zQ== X-Gm-Message-State: AA6/9RnaCA5tc6NK4Dw3mFMFxtO9JsI4Xa+ZMx2hW1b15XHACYjabHhzqa+NT+a28G2MxUqGdpEyJKg9W/Zmkggk X-Received: by 10.36.117.6 with SMTP id y6mr1354363itc.102.1475191785155; Thu, 29 Sep 2016 16:29:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.118.75 with HTTP; Thu, 29 Sep 2016 16:29:44 -0700 (PDT) In-Reply-To: References: From: David Yan Date: Thu, 29 Sep 2016 16:29:44 -0700 Message-ID: Subject: Re: Retraction To: dev@apex.apache.org Content-Type: multipart/alternative; boundary=001a114a9b2e55a0cf053daddaa1 archived-at: Thu, 29 Sep 2016 23:29:57 -0000 --001a114a9b2e55a0cf053daddaa1 Content-Type: text/plain; charset=UTF-8 Hi Shunxin: Yes, a retraction is just to tell downstream whatever the windowed operator sent before was wrong. In this blog ( https://www.oreilly.com/ideas/the-world-beyond-batch-streaming-102), their normal trigger value is an integer and the retraction trigger is just the negative of the previous integer, and it assumes the downstream will understand that, which it will if the downstream only does a delta (addition or subtraction) to its state based on the incoming tuple, without any regard to whether the trigger is a normal trigger or a retraction trigger. If the downstream needs to distinguish between normal and retraction triggers, the user can override fireRetractionTrigger method. But I think in a real use case, the downstream mostly likely can just overwrite the old value with the new value so retraction is not needed. And retraction is likely to be used mostly with session windows, because for session windows, we need a way to tell downstream that some session windows are not valid any more (result from session window merge or extension), and I think exactly how retractions are handled is up to the application. For now, I think it's fine for general purpose accumulations (like TopN or ReduceN) to return null for the getRetraction method. David On Thu, Sep 29, 2016 at 3:56 PM, Shunxin Lu wrote: > Hi, > > I am planning to revisit the accumulation implementations and rewrite the > getRetraction() method so that it behaves correctly. I understand that the > concept of retraction is the upstream operator telling its downstream that > the previous output is wrong and give it a new output. But it become > confusing when it comes to actual implementation, how exactly should > retraction be done in accumulations such as TopN and ReduceFn? > > Thanks! > Shunxin Lu > --001a114a9b2e55a0cf053daddaa1--