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 CC3DC200B8E for ; Mon, 26 Sep 2016 21:43:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CA88A160ACA; Mon, 26 Sep 2016 19:43:03 +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 E68D3160AC8 for ; Mon, 26 Sep 2016 21:43:02 +0200 (CEST) Received: (qmail 1886 invoked by uid 500); 26 Sep 2016 19:43:02 -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 1869 invoked by uid 99); 26 Sep 2016 19:43:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Sep 2016 19:43:01 +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 65FE8C0C0D for ; Mon, 26 Sep 2016 19:43:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.279 X-Spam-Level: * X-Spam-Status: No, score=1.279 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-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-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ii7qqFUbrXww for ; Mon, 26 Sep 2016 19:42:58 +0000 (UTC) Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com [209.85.220.174]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 5EDEC5FCED for ; Mon, 26 Sep 2016 19:42:58 +0000 (UTC) Received: by mail-qk0-f174.google.com with SMTP id t7so178619942qkh.2 for ; Mon, 26 Sep 2016 12:42:58 -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=9n7V1R1TBHsUecPejii2URFAz6pBIch3EVtGLWxMiDE=; b=uWmyhCADVFVZLm3rdGRJrZBmiIPjzmkuVZssV1HygP+SlFs0iGjYYeyiDKVGGPbf52 FoUZoThBDK65RyXUrnueVfD0cmJ2sAswm6rWDUhVmqhsOeXJG5TZ4cs+DvOcxXUepxQF /vlZ3M6HKoPd4xXtsnVUaLgUQVJZW/+wmAdnssUjeKhbKN18yWd5AALTHk1nn5Zn7w7K 7HE7ubrLQWnyVuBSFPXRpWEfhV7sK0EUiqFFsDiqLEbyclxl81JejzsYrAVnbWKpbfGl aYzs78+l06Vug6TUY/geXN26Qks8E7P5+aY4ljJ56TkZpC/DZIRXCkCZMXAyyWqvI6sU xWbw== 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=9n7V1R1TBHsUecPejii2URFAz6pBIch3EVtGLWxMiDE=; b=jLnPaawJRiwPea24uCQUFEarH3ifmrRsg8k9DGg759M/sNZPAqits/vSrHnq9VOyQH 8oggUIcgV/BTKhOcDkL/tyH1PbszE3woSw/cC+4QeKZ5MlVti3vdyJYhfcOPfmS1BfZm Y1zyM4amW3F8DZ/bJ12LunyIAQsbK1mZhzuGBPCAYW/fTaKikbc+JXgz+UBXr8VT2x3J lF4ld89yTpfdHUm8K7iGS8zjTxEJFF6xBM3hRpxzvIusYU+Z/AUx4WwUxjs1G1OF5vh5 0JwbNKnWb9ZMyhv3YJje48hHfrFRJK9Ds9TfItOdAIEAY+uvv32ieU+N7aMielNMZqXH 8g2g== X-Gm-Message-State: AA6/9Rmtdv0Ss5VrpxJlR23npEdy0nxvib6G9mjDT3zu7X+4D9YkFDrxWw2oPre9buJGA2xvPBUcD1DSfTX8c7Mp X-Received: by 10.55.153.6 with SMTP id b6mr16424068qke.89.1474918977807; Mon, 26 Sep 2016 12:42:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.45.129 with HTTP; Mon, 26 Sep 2016 12:42:57 -0700 (PDT) In-Reply-To: References: From: David Yan Date: Mon, 26 Sep 2016 12:42:57 -0700 Message-ID: Subject: Re: Watermark generation in Windowed Operators To: dev@apex.apache.org Content-Type: multipart/alternative; boundary=94eb2c07eb1abed07b053d6e5572 archived-at: Mon, 26 Sep 2016 19:43:04 -0000 --94eb2c07eb1abed07b053d6e5572 Content-Type: text/plain; charset=UTF-8 Chinmay, Just to clarify, the Join Operator does not support theta joins. It only supports equi-joins on either the Window, or both the Window and the Key. David On Sat, Sep 17, 2016 at 1:30 AM, Chinmay Kolhatkar wrote: > Thanks for the information guys. > > David, I can take a look at heuristic watermark if I get any free cycles. > > Shunxin, does the Join operator that you're implementing support theta join > or is it subset of the theta join? > > Thanks, > Chinmay. > > > > On Sat, Sep 17, 2016 at 1:21 AM, David Yan wrote: > > > Hi Shunxin, > > > > If the watermark code in your PR is not behaving the way it should, > please > > do change it. Thanks! > > > > David > > > > On Fri, Sep 16, 2016 at 11:36 AM, Shunxin Lu > wrote: > > > > > Hi David, > > > > > > Thanks for the clarification. Should we update the watermark for join > > > operator when there's a watermark arrived from one of the input streams > > > even if the watermark from another input stream is not arrived yet? > > > > > > Shunxin > > > > > > On Fri, Sep 16, 2016 at 10:59 AM, David Yan > > wrote: > > > > > > > Actually, that's not entirely true. Here are the points about the > > > watermark > > > > tuple generation of the join operator: > > > > > > > > 1) We keep the timestamp of the latest watermark for each input port > > > > > > > > 2) We keep another timestamp that is equal to minimum of all the > > > timestamps > > > > mentioned in (1). > > > > > > > > 3) Upon arrival of a watermark from an input port, we update the > > > timestamp > > > > mentioned in (1), and evaluate (2). If the value of (2) changes, we > > > > generate the watermark tuple with the timestamp that is equal to the > > new > > > > value of (2). > > > > > > > > 4) That means initially, the watermark is only generated when we have > > > seen > > > > a watermark for all input ports. And the fact that we take the > smallest > > > > timestamp in (2) means we only consider a window as late only if all > > > input > > > > streams say that particular window is late. > > > > > > > > David > > > > > > > > > > > > On Fri, Sep 16, 2016 at 10:42 AM, Shunxin Lu > > > wrote: > > > > > > > > > Hi Chinmay, > > > > > > > > > > Base on the discussion I had with David, and David please correct > me > > > if I > > > > > am wrong, the watermark for Windowed Join Operator should be indeed > > > > > depending on all the input streams. If a tuple is considered late > for > > > one > > > > > input stream, it should also be considered late for the whole join > > > > > operator. That's why in the AbstractWindowedJoinOperator, it always > > > > selects > > > > > the watermark with the smallest timestamp from all the latest > > > watermarks > > > > > coming from upstreams as its current watermark, so that it can make > > > sure > > > > > that it's always keeping the strictest watermark to eliminate late > > > > tuples. > > > > > > > > > > Shunxin > > > > > > > > > > On Fri, Sep 16, 2016 at 10:02 AM, David Yan > > > > > wrote: > > > > > > > > > > > I think in theory, the watermark should be sent by the input > > operator > > > > > since > > > > > > the input should have the knowledge of the criteria of lateness > > since > > > > it > > > > > > can depend on many factors like the time of the day, the source > of > > > the > > > > > data > > > > > > (e.g. mobile data), that the WindowedOperator should in general > > make > > > no > > > > > > assumption about. > > > > > > > > > > > > However, I think it's possible to implement some kind of > watermark > > > > > > generation in the WindowedOperator itself if that knowledge is > not > > > > > > available from the input. It's actually already doing that if you > > > call > > > > > > the setFixedWatermark > > > > > > method, which will generate a watermark tuple, with a timestamp > > that > > > is > > > > > > based on the derived time from the streaming window id, > downstream > > > for > > > > > each > > > > > > streaming window. It's possible to add the support of heuristic > > > > watermark > > > > > > generation as well and you're welcome to take that up. > > > > > > > > > > > > For the Windowed Join operator, the watermark generated for > > > downstream > > > > > > depends on the watermark arriving from each input stream, and > it's > > > not > > > > > just > > > > > > a simple propagate. Shunxin can comment more on this. > > > > > > > > > > > > David > > > > > > > > > > > > > > > > > > On Thu, Sep 15, 2016 at 11:21 PM, Chinmay Kolhatkar < > > > > chinmay@apache.org> > > > > > > wrote: > > > > > > > > > > > > > Hi All, > > > > > > > > > > > > > > I was looking at Windowed Operator APIs and have to mention > > they're > > > > > > pretty > > > > > > > nicely done. > > > > > > > > > > > > > > I have a question related to watermark generation. > > > > > > > > > > > > > > What I understood is that for completion of processing of an > > event > > > > > window > > > > > > > one has provision for sending of watermark tuple from some > > previous > > > > > stage > > > > > > > in the DAG. I want to know who should be doing that and when > > should > > > > be > > > > > it > > > > > > > done. > > > > > > > > > > > > > > For e.g. I saw a PR of Windows Join Operator in apex-malhar > and I > > > > would > > > > > > > like to use it in my application. Can someone give me an > example > > of > > > > > how a > > > > > > > DAG will look like with this operator which has a stage which > > > > generates > > > > > > > watermark? And how should that stage decide on when to > generate a > > > > > > watermark > > > > > > > tuple? > > > > > > > > > > > > > > -Chinmay. > > > > > > > > > > > > > > > > > > > > > > > > > > > > --94eb2c07eb1abed07b053d6e5572--