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 4E5CC200D09 for ; Tue, 12 Sep 2017 18:35:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4D1061609C7; Tue, 12 Sep 2017 16:35:13 +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 6BF141609B4 for ; Tue, 12 Sep 2017 18:35:12 +0200 (CEST) Received: (qmail 74973 invoked by uid 500); 12 Sep 2017 16:35:10 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 74947 invoked by uid 99); 12 Sep 2017 16:35:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 16:35:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DC2DCC8DBA for ; Tue, 12 Sep 2017 16:35:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.199 X-Spam-Level: X-Spam-Status: No, score=0.199 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id x_8NvuGy9MhG for ; Tue, 12 Sep 2017 16:35:08 +0000 (UTC) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id F2F0F5F640 for ; Tue, 12 Sep 2017 16:35:07 +0000 (UTC) Received: by mail-io0-f176.google.com with SMTP id g32so33131768ioj.2 for ; Tue, 12 Sep 2017 09:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=x6/QyaTLtYVMFkQuTyl1tW/1oormnafjUdIdJ08tulI=; b=DuzekoBiLCre2wFYUF7nS/k5YR2oIOixONliXTTOS6N+23T1raZaD6kfK55fWef1O4 7zD7kiWYmeA+WfT1jZplKAB5pv+K/h5FGcLnV+FSohv2qFUBEkyFnJv32U1tVP40wenN axJjGQnQ0NZFZ/69KsUQ7lgWz1Kl5n06+FLw7y4LdAoNEPbIksFvbc472Qk7KmiAzAtr DezqC8pmqjDKV1PY0LALEo1fk6+h/WXeBP/IGmXZ3A3+upjZgXH02B7vmv2buL2Ri56i 7uiSLos+JSRiNY7XeFNBZEtb6NiV2kMj/Y/ChisTbJXuijvxkYD9yqzX4+lM2vlbt2dK 426Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=x6/QyaTLtYVMFkQuTyl1tW/1oormnafjUdIdJ08tulI=; b=beXswpqc1Dl4Jt2Ed51Y3YjTsh/YIzCOjodqmcnZBptzCjAolp/al6vABRgEGVCPbI swDC0IUg5VXR9Nfw7dr54w0t25Z1YP5WKNSNUqr4Z/6M5uvyrdKxDeHVJhKfTZHct87J 4Zew5GLGyssWeWDeRmp0P6Qo35k8FyBeWsiejS+ZxgXdJGn0+4/x2lkidX1HzMGXCbAk +gP/euZA9Tci9JmEdQp2gTrgQ8lH6fJ4Jbp7SgA08cZk9DyH2LDABi+USVsAAvq1VPP+ J02wfFEnDXx8a6rIq+k8kdG1Hi8/IrnfMki0l0RApTimqeWnTN6G+uUXuX4Uv8zm+g67 CF5w== X-Gm-Message-State: AHPjjUgcHik1Hqrbl/3h2E2w3E1zNnpXch4vC4O12MUOtxejC8frUHrc ekUnvZzRNQ4oPJqeL/PfUfOpYuTl44D+ X-Google-Smtp-Source: AOwi7QAhSYsJZ5+8BkY/pimgWGp73/CrNRLC4tY9MtX5xe6/rjtqk6vZjMW8GILdwQXbbK+d7+/QLsWa3wOeG3+26+M= X-Received: by 10.202.193.65 with SMTP id r62mr16486567oif.313.1505234106449; Tue, 12 Sep 2017 09:35:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.91.65 with HTTP; Tue, 12 Sep 2017 09:35:05 -0700 (PDT) In-Reply-To: References: <5a26383b-7d2e-9b02-6f56-7d207f565f23@gmail.com> <663b5cbd-2983-4501-e01b-e4803b77ccf1@gmail.com> <3f745905-597a-d944-0239-b177e524aa16@gmail.com> <6bc1acdd-d761-2a23-f1e2-b7b21e261ad8@gmail.com> From: Vladimir Ozerov Date: Tue, 12 Sep 2017 19:35:05 +0300 Message-ID: Subject: Re: ContinuousQueryWithTransformer implementation questions - 2 To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="001a113f5b903831f3055900a09a" archived-at: Tue, 12 Sep 2017 16:35:13 -0000 --001a113f5b903831f3055900a09a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Nikolay, Public API is the face of our product. We cannot and do not want to change it in a rush. This ticket was in a backlog for more than 2 years. It is not a big problem if we spend additional week or month for API design. It is much better to extend confusing behavior on already confusing and overengineered API. On Tue, Sep 12, 2017 at 6:47 PM, =D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9= =D0=98=D0=B6=D0=B8=D0=BA=D0=BE=D0=B2 wrote: > Vova > > > I propose to deprecate current continuous queries and develop new API. > > This should not break anything. > > If the community agrees that *whole* continuous query API is bad - it OK. > Let's develop new API. > > But developing new public API and implementing it is a very long process. > One can see it based on this thread :) > > I think my implementation [1] of transformers for ContinuousQuery make > things better for a user because remote transformers can lead to > significant performance win. > > > Adding transformers on top of current API will make it total mess. > > I propose two things: > > 1. Continue discussion of current task [2] with scope limited by current > API. > 2. Start a discussion and work on new API. I think we can start with > listing things that make current API bad. I can drive such a discussion. > > [1] https://github.com/apache/ignite/pull/2372 > [2] https://issues.apache.org/jira/browse/IGNITE-425 > > > 2017-09-12 17:55 GMT+03:00 Dmitriy Setrakyan : > > > Vladimir, are their factories for the proposed listeners? > > > > On Tue, Sep 12, 2017 at 7:52 AM, Alexey Goncharuk < > > alexey.goncharuk@gmail.com> wrote: > > > > > Vladimir, > > > > > > Can you please clarify how the proposed API will work? > > > > > > My opinion is that our query API is big piece of ... you know, > especially > > > > ContinuousQuery. A lot of concepts and features are mixed in a sing= le > > > > entity, what makes it hard to understand and use. Let's finally > > deprecate > > > > ContinuousQuery and design nice and consistent API. E.g.: > > > > > > > > interface IgniteCache { > > > > UUID addListener(CacheEntryListener listener) > > > > void removeListener(UUID listenerId); > > > > } > > > > > > > > This method set's a listener on all nodes which will process event > > > locally, > > > > no network communication. > > > > > > > > > Do I understand correctly that CacheEntryListener will have a method > like > > > onEvent() which will accept the cache event? > > > > > > > > > > Now if you want semantics similar to existing > > > > continuous queries, you use special entry listener type: > > > > > > > > class ContinuousQueryCacheEntryListener implements > CacheEntryListener > > { > > > > ContinuousQueryRemoteFilter rmtFilter; > > > > ContinuousQueryRemoteTransformer rmtTransformer; > > > > ContinuousQueryLocalCallback locCb; > > > > } > > > > > > > > > > > This becomes confusing: while the ContinuousQueryCacheEntryListener > > itself > > > has the onEvent() method, which is supposed to be called on event > nodes, > > it > > > also has a rmtFilter, which will also be called on event nodes. Will > the > > > onEvent() then invoked on the listener anyway, regardless of the filt= er > > > result? Finally, the listener will have a local callback field, which > > will > > > be called on the originating node. This sounds way more tricky to me > than > > > the current API. > > > > > > > > > > Last, "initial query" concept should be dropped from "continuous > query" > > > > feature completely. It doesn't guarantee any kind of atomicity or > > > > visibility wrt to cache events, so it adds no value. The same > behavior > > > > could be achieved as follows: > > > > > > > > cache.addListener(...) > > > > QueryCursor cursor =3D cache.query(initialQuery); > > > > > > > > > > > Agree with this. > > > > > > > > > -- > Nikolay Izhikov > NIzhikov.dev@gmail.com > --001a113f5b903831f3055900a09a--