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 D617E200C51 for ; Sun, 9 Apr 2017 12:55:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C85C9160BA4; Sun, 9 Apr 2017 10:55: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 BEFCE160B7D for ; Sun, 9 Apr 2017 12:55:02 +0200 (CEST) Received: (qmail 37682 invoked by uid 500); 9 Apr 2017 10:55:01 -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 37670 invoked by uid 99); 9 Apr 2017 10:55:01 -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; Sun, 09 Apr 2017 10:55:01 +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 0939BC2F4F for ; Sun, 9 Apr 2017 10:55:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 15DdNZqU1u0f for ; Sun, 9 Apr 2017 10:54:58 +0000 (UTC) Received: from mail-yb0-f169.google.com (mail-yb0-f169.google.com [209.85.213.169]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DDDCE5F1E9 for ; Sun, 9 Apr 2017 10:54:57 +0000 (UTC) Received: by mail-yb0-f169.google.com with SMTP id l201so24829432ybf.0 for ; Sun, 09 Apr 2017 03:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=gKLnoaOis5TjNwq4aIPIEmY4SorGlPDNjVzj0u4zSPk=; b=N+Ywhe7ddtpRvNe4aXqYGbcqi2yQio6fexhnS0glcukmOuEbb4XeW7vXEBLqno+Kmm g+IrRdWS0tLYGxeH/BPrBI6qxqP/EITROhNVbAGmmjTN24YAzdHLVuZDyLKhN7i2yCBR wINqKChFoFfmTXgt/mOqJWUHhgsR8qdJaHvJMcdoz+kCzPHcEdlNRxbF4PJRpSWNMqBZ GDQ1qgvbIh/pdnSziMNGN7Qr0vbDdK7vLRP8iL/f1TbuJfkc4HBD5E3i910hIf55h47T D++DuE1+BVl3GDZ1DK8hcXtySvnSc7xH7BcmEv+XZSAINGG23A1p7QElgcRTiKC+gmbH iN/A== 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=gKLnoaOis5TjNwq4aIPIEmY4SorGlPDNjVzj0u4zSPk=; b=CUtTBzAs6NxmK0EQLIizZMbQLLsqryMvLxEhSgFm9OrQuPfNpvwKs/G9TBAPfKB+P3 clwzrNt0nrZkYH3fTKqtNe0hSrp6tjRm5BwK723I04eH4ZoNpTKKL5++QwaiL8/KzjIL Av2TJXTeT+kXO5TO7L4fOn281ZoTJHr3ZA8UCilCNQPHG4h+0zmt34KBFTMrl6YpA+Am iW1g7iwJfxNWFBICv69AEmoFe4G0iQpFMUafGvmLPpVTIoV9md5jU5RMZudkQCI9nQWo PbwkpZixtxMF6kggnYtpN2+txa9x9Y77pko+UiXyDJpFvrSr/cJ0pqq5kiFCnr2Vs4O2 k78g== X-Gm-Message-State: AN3rC/7BgVTcFCdDO+qvu6NbXQ1cyXGbcb2shTvvPUMnqcr9cQ1HhwaNWHUL2HRYo1u3WY2Q8RaOtNc6ePzLdg== X-Received: by 10.37.104.14 with SMTP id d14mr14994403ybc.27.1491735296670; Sun, 09 Apr 2017 03:54:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.220.131 with HTTP; Sun, 9 Apr 2017 03:54:16 -0700 (PDT) In-Reply-To: References: <5D9118AC-CAE9-47FC-92CC-339AC5A86675@apache.org> From: Sergi Vladykin Date: Sun, 9 Apr 2017 13:54:16 +0300 Message-ID: Subject: Re: Stable binary key representation To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=f403045c01fe750400054cb9b009 archived-at: Sun, 09 Apr 2017 10:55:04 -0000 --f403045c01fe750400054cb9b009 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ok, we need to do 2 things here: 1. Drop the resolvers from the source code. 2. Write a good page in docs on "What makes a correct cache key". Who can do that? Sergi 2017-04-07 9:48 GMT+03:00 Sergi Vladykin : > It is possible to try adding support of comparison to Resolvers, but the > whole approach looks wrong and for now it is better to get rid of it whil= e > we have a chance to break compatibility. > > Sergi > > 2017-04-07 9:19 GMT+03:00 Valentin Kulichenko < > valentin.kulichenko@gmail.com>: > >> The discussion should've been started with that :) If supporting resolve= rs >> in new architecture is not possible or means too big effort, then it's >> definitely not worth it. >> >> -Val >> >> On Thu, Apr 6, 2017 at 8:52 PM, Vladimir Ozerov >> wrote: >> >> > Dima, >> > >> > Yes, they may explode some internals of our indexes. >> > >> > 06 =D0=B0=D0=BF=D1=80. 2017 =D0=B3. 23:32 =D0=BF=D0=BE=D0=BB=D1=8C=D0= =B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Dmitriy Setrakyan" < >> > dsetrakyan@apache.org> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: >> > >> > > Guys, >> > > >> > > Isn't the main issue here that we cannot use the Identity Resolvers = in >> > > BTrees in the 2.0 version? If yes, then we have to remove them no >> matter >> > > what. >> > > >> > > D. >> > > >> > > On Thu, Apr 6, 2017 at 1:23 PM, Sergi Vladykin < >> sergi.vladykin@gmail.com >> > > >> > > wrote: >> > > >> > > > Binary key representation is stable when we always have equal >> > serialized >> > > > bytes when the original keys are equal. >> > > > >> > > > Resolver allows you to have some extra info in the Key and equal >> Keys >> > > will >> > > > be serialized into different bytes, which is wrong. >> > > > >> > > > Look at the example what you can do with resolvers: >> > > > >> > > > We may have some data entry with fields a, b, c. Let's say the >> unique >> > > part >> > > > here is `a` and it the only fields used in Key equals() and >> hashCode(). >> > > > Still we may have the following layouts: >> > > > >> > > > 1. Ka -> Vbc >> > > > 2. Kab -> Vc >> > > > 3. Kabc -> Boolean.TRUE >> > > > >> > > > The only 1 is a correct layout, others are plain wrong variants (b= ut >> > they >> > > > are still possible with Resolvers) because everything that does no= t >> > make >> > > > Key unique must be in Value. >> > > > >> > > > We want to clearly state that if you have something in Key, that i= s >> not >> > > > part of equals(), then the Key is invalid and that stuff must be i= n >> > > Value. >> > > > This allows us to rely on binary representation of a Key to be >> stable >> > and >> > > > have some more optimizations and code simplifications with respect >> to >> > > these >> > > > assumptions. >> > > > >> > > > Sergi >> > > > >> > > > 2017-04-06 14:24 GMT+03:00 Valentin Kulichenko < >> > > > valentin.kulichenko@gmail.com>: >> > > > >> > > > > Even with my vast expirience I would never claim that I've seen >> > > > > "everything" :) >> > > > > >> > > > > What do you mean by stable binary key representation and how >> > resolvers >> > > > make >> > > > > it unstable? >> > > > > >> > > > > -Val >> > > > > >> > > > > On Thu, Apr 6, 2017 at 2:36 AM, Sergi Vladykin < >> > > sergi.vladykin@gmail.com >> > > > > >> > > > > wrote: >> > > > > >> > > > > > Val, >> > > > > > >> > > > > > I know that you have really vast experience in Ignite >> deployments >> > and >> > > > > > probably saw everything that can happen. Did you ever see >> identity >> > > > > > resolvers use in real life? I guess no. >> > > > > > >> > > > > > Hibernate example is bad here, because if their key is unstabl= e >> > > across >> > > > > > multiple JVMs, it means that it was not designed for distribut= ed >> > > > caches a >> > > > > > priori. >> > > > > > >> > > > > > Also knowing in advance about stable binary key representation >> > allows >> > > > us >> > > > > to >> > > > > > apply additional optimizations, like comparing keys without >> > detaching >> > > > > them >> > > > > > from offheap memory. >> > > > > > >> > > > > > We always will be able to add this stuff back if we see users >> > really >> > > > need >> > > > > > it. Let's remove it for 2.0. >> > > > > > >> > > > > > Sergi >> > > > > > >> > > > > > 2017-04-06 11:21 GMT+03:00 Valentin Kulichenko < >> > > > > > valentin.kulichenko@gmail.com>: >> > > > > > >> > > > > > > Alex, >> > > > > > > >> > > > > > > To be honest, I don't understand the reasoning behind the >> > removal. >> > > I >> > > > > > think >> > > > > > > resolvers provide good flexibility for different corner case= s >> and >> > > > it's >> > > > > a >> > > > > > > good thing to have them. Note that they can be applied not >> only >> > to >> > > > > cache >> > > > > > > keys, but to any binary objects. >> > > > > > > >> > > > > > > Hibernate issue is actually a good example of such use case. >> The >> > > fact >> > > > > > that >> > > > > > > we found an alternative solution doesn't actually mean >> anything, >> > > > > because >> > > > > > > what if this happened not in our module, but in user's >> > application? >> > > > > > > Unfortunately, we can't predict everything. >> > > > > > > >> > > > > > > Error proneness is not a very strong argument either, becaus= e >> in >> > my >> > > > > view >> > > > > > > these resolvers are as much error prone as BinaryIdMapper, f= or >> > > > example. >> > > > > > > >> > > > > > > -Val >> > > > > > > >> > > > > > > On Wed, Apr 5, 2017 at 11:44 PM, Alexey Goncharuk < >> > > > > > > alexey.goncharuk@gmail.com> wrote: >> > > > > > > >> > > > > > > > Denis, >> > > > > > > > >> > > > > > > > Can you suggest a use-case where identity resolver is need= ed >> > > (given >> > > > > > that >> > > > > > > we >> > > > > > > > agree that a key must contain only valuable fields)? >> > > > > > > > >> > > > > > > > 2017-04-05 22:08 GMT+03:00 Denis Magda = : >> > > > > > > > >> > > > > > > > > Where do you want to remove the identity resolvers from? >> If >> > > it=E2=80=99s >> > > > > > > related >> > > > > > > > > to the internals of Hibernate module then it=E2=80=99s f= ine but if >> > you >> > > > > > suggest >> > > > > > > > > removing identity resolvers public interfaces then it >> might >> > be >> > > a >> > > > > > haste >> > > > > > > > > decision. >> > > > > > > > > >> > > > > > > > > =E2=80=94 >> > > > > > > > > Denis >> > > > > > > > > >> > > > > > > > > > On Apr 5, 2017, at 7:42 AM, Alexey Goncharuk < >> > > > > > > > alexey.goncharuk@gmail.com> >> > > > > > > > > wrote: >> > > > > > > > > > >> > > > > > > > > > +1, I see no other reasons to keep it. >> > > > > > > > > > >> > > > > > > > > > 2017-04-05 13:59 GMT+03:00 Sergi Vladykin < >> > > > > > sergi.vladykin@gmail.com >> > > > > > > >: >> > > > > > > > > > >> > > > > > > > > >> +1 >> > > > > > > > > >> >> > > > > > > > > >> Lets drop them. >> > > > > > > > > >> >> > > > > > > > > >> Sergi >> > > > > > > > > >> >> > > > > > > > > >> 2017-04-05 13:50 GMT+03:00 Dmitriy Govorukhin < >> > > > > > > > > >> dmitriy.govorukhin@gmail.com> >> > > > > > > > > >> : >> > > > > > > > > >> >> > > > > > > > > >>> Hi guys, i implemented proxy for IgniteCache in >> hibernate >> > > > > > > > integration, >> > > > > > > > > >> this >> > > > > > > > > >>> proxy transformate cacheKey to our key wrapper, leav= es >> > only >> > > > > > > required >> > > > > > > > > >>> field. I think we can remove identity resolve, it >> should >> > > not >> > > > > > broke >> > > > > > > > > >>> integration with hibernate. Any objections? >> > > > > > > > > >>> >> > > > > > > > > >>> On Wed, Mar 29, 2017 at 11:07 PM, Valentin Kulichenk= o >> < >> > > > > > > > > >>> valentin.kulichenko@gmail.com> wrote: >> > > > > > > > > >>> >> > > > > > > > > >>>> I'm not saying there is no alternative solution. Bu= t >> > let's >> > > > > > > implement >> > > > > > > > > it >> > > > > > > > > >>> and >> > > > > > > > > >>>> prove that it works first, and remove resolvers onl= y >> > after >> > > > > that. >> > > > > > > > > >>>> >> > > > > > > > > >>>> -Val >> > > > > > > > > >>>> >> > > > > > > > > >>>> On Wed, Mar 29, 2017 at 12:18 PM, Sergi Vladykin < >> > > > > > > > > >>> sergi.vladykin@gmail.com >> > > > > > > > > >>>>> >> > > > > > > > > >>>> wrote: >> > > > > > > > > >>>> >> > > > > > > > > >>>>> Guys, nothing is impossible if you know a bit abou= t >> > > > > reflection >> > > > > > in >> > > > > > > > > >> Java >> > > > > > > > > >>> :) >> > > > > > > > > >>>>> >> > > > > > > > > >>>>> We had a look at the CacheKey class and it is easi= ly >> > > > > > replaceable. >> > > > > > > > > >>>>> >> > > > > > > > > >>>>> Sergi >> > > > > > > > > >>>>> >> > > > > > > > > >>>>> >> > > > > > > > > >>>>> >> > > > > > > > > >>>>> 2017-03-29 21:49 GMT+03:00 Dmitriy Setrakyan < >> > > > > > > > dsetrakyan@apache.org >> > > > > > > > > >>> : >> > > > > > > > > >>>>> >> > > > > > > > > >>>>>> On Wed, Mar 29, 2017 at 11:43 AM, Valentin >> Kulichenko >> > < >> > > > > > > > > >>>>>> valentin.kulichenko@gmail.com> wrote: >> > > > > > > > > >>>>>> >> > > > > > > > > >>>>>>> "Hibernate key" is the CacheKey class I was >> referring >> > > to. >> > > > > > It's >> > > > > > > > > >>>> provided >> > > > > > > > > >>>>>> by >> > > > > > > > > >>>>>>> Hibernate, not by user and not by us. So I'm not >> sure >> > > > it's >> > > > > > > > > >> possible >> > > > > > > > > >>>> to >> > > > > > > > > >>>>>>> replace it. >> > > > > > > > > >>>>>>> >> > > > > > > > > >>>>>> >> > > > > > > > > >>>>>> If it is impossible to replace or get rid of the >> > > Hibernate >> > > > > > key, >> > > > > > > is >> > > > > > > > > >>> this >> > > > > > > > > >>>>>> discussion valid at all? >> > > > > > > > > >>>>>> >> > > > > > > > > >>>>> >> > > > > > > > > >>>> >> > > > > > > > > >>> >> > > > > > > > > >> >> > > > > > > > > >> > > > > > > > > >> > > > > > > > >> > > > > > > >> > > > > > >> > > > > >> > > > >> > > >> > >> > > --f403045c01fe750400054cb9b009--