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 D61AD200D4B for ; Mon, 27 Nov 2017 11:25:29 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D48FA160C14; Mon, 27 Nov 2017 10:25:29 +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 008F6160C02 for ; Mon, 27 Nov 2017 11:25:28 +0100 (CET) Received: (qmail 41929 invoked by uid 500); 27 Nov 2017 10:25:28 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 41918 invoked by uid 99); 27 Nov 2017 10:25:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2017 10:25: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 38476180414 for ; Mon, 27 Nov 2017 10:25:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.679 X-Spam-Level: * X-Spam-Status: No, score=1.679 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_LOW=-0.7, 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: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id hjsvYwRXb3-H for ; Mon, 27 Nov 2017 10:25:25 +0000 (UTC) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C760A5F21E for ; Mon, 27 Nov 2017 10:25:24 +0000 (UTC) Received: by mail-it0-f53.google.com with SMTP id x13so20354396iti.4 for ; Mon, 27 Nov 2017 02:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=hmAoQ+y9fl9g5N8D5WhIv2lnnvAPxHuF0fp3R1yRSI0=; b=aQYU3PpbLSsxOdypePfROCSlMSJoE9cyXimXusRAj+LOdJ+p4QKLhmaJVvqqbayqTi YwQnNYjbfrKf7yRu4IXn9hJk7ytoCm9CKO6GzHCiPM+5hWfUii1x3EMQA8jAZ9eJ2JOK xLxUxfen6vHzyQWCswgOkw1ouGaBEnMslCZfXQvyM4ZcxLBn6zeezCTXnxFL7KHMiAqV SOrOc7Ecgv2xwSmMY1wtnT7mtLsVC6ed4/wfn1ej369ryYOCTyjgeLwUNpz4dGnlmqWp RWhtPIDlg1H8SQ2sYdkwNKPHwP7Yk5Qqvntj2Q6xH75Gnrh19lST09+LN7jD0Quqois8 Fj6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=hmAoQ+y9fl9g5N8D5WhIv2lnnvAPxHuF0fp3R1yRSI0=; b=KZ2Mk1r3FndxUqf91PDZhTlmDLQJz7jhaqFrFI1CnU1S4U+3ambOVfxFEHQmH457ae RfOo0wBY4Ssf2tc4suwiK6z51vXdXKK71iUvxxtQt3TpwNdjh3CfSSTT5Kcg6j5tjHLP JNMDgJFRzdzBwvOrxTV0zyPch3sFmfxnBA1Z3CNeRjYE2H2eMh0iuxRnh5yeeQ7Lbt3W HRSGmN7x8Fe4KXuRiQwsIuAyu85nLFhCK84XpPmjG4zpUUk7x2DaJZliWmhG9BqZxmEf aOHmCslq0JtGbKAhnHtg6d37KK9BfZ8PgsfqG0aK4/qUVl4mMyyMeGlXfDeYjuWk90kG PNOg== X-Gm-Message-State: AJaThX7pMiK685gIBd9V2sQxyintfyZH9nAk9XmJhHGsJKX3JTxNl92d L4s954OBg2MahqStKcdFC6YQLtnZkxe5TKrmcks= X-Google-Smtp-Source: AGs4zMZlIAMr2Bv7SfpTC9BbERiXlHp6tE8cx+krA20ZjpSQFQtfamyvH/tYhLBedIG3PnZkHN0I6nFy5THIDhLfwDQ= X-Received: by 10.36.84.72 with SMTP id t69mr7614838ita.74.1511778323284; Mon, 27 Nov 2017 02:25:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Denis Mekhanikov Date: Mon, 27 Nov 2017 10:25:12 +0000 Message-ID: Subject: Re: AffinityKey question To: user@ignite.apache.org Content-Type: multipart/alternative; boundary="001a1143b798f048e8055ef45198" archived-at: Mon, 27 Nov 2017 10:25:30 -0000 --001a1143b798f048e8055ef45198 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mikael, If you choose to use *AffinityKey* to wrap your keys, then you should use it everywhere. Because basically it's just a tuple of a key and affinity key, so this pair is used as a composite key. You can also annotate some field of you key class with *@AffinityKeyMapped*= , instead of using *AffinityKey* wrapper*.* To see all options, refer to the following page of documentation: https://apacheignite.readme.io/docs/affinity-collocation Denis =D0=BF=D0=BD, 27 =D0=BD=D0=BE=D1=8F=D0=B1. 2017 =D0=B3. =D0=B2 1:19, Mikael= : > I was hoping it would work with either one as it is using equals() for > comparison and AffinityKey calls the keys hash/equals method. > > I guess I have to keep the AffinityKeys stored somewhere to make it work. > > Thanks > > Mikael > > Den 2017-11-26 kl. 21:36, skrev Gaurav Bajaj: > > Hi, > > You have to alwaya use affinity key to access the Cache for any get, put, > remove operation you do. Key should be exactly same as you used to put > value else it won't be able to find it. > > Thanks, > Gaurav > > On 26-Nov-2017 3:19 PM, "Mikael" wrote: > > Hi! > > If I do a cache.put( new AffinityKey( key, value), myvalue); and later on > want to update the value, do I need do a: > > cache.put( new AffinityKey( key, value), newvalue); or can I do: > > cache.put( key, newvalue); > > If I do a put on a value that is already in the cache using a "non" > affinity key, will the existing affinity information on the key be lost o= f > I don't use the AffinityKey everytime I update the cache ? > > > > > --001a1143b798f048e8055ef45198 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Mikael,

If you choose to use Affinit= yKey=C2=A0to wrap your keys, then you should use it everywhere. Because= basically it's just a tuple of a key and affinity key, so this pair is= used as a composite key.

You can also annotate so= me field of you key class with=C2=A0@AffinityKeyMapped, instead of u= sing AffinityKey wrapper.
To see all options, refer= to the following page of documentation:=C2=A0https://apacheignite.readme.io/docs= /affinity-collocation

Denis

=D0=BF=D0=BD, 27 =D0=BD=D0=BE=D1=8F=D0= =B1. 2017 =D0=B3. =D0=B2 1:19, Mikael <mikael-aronsson@telia.com>:
<= /div>
=20 =20 =20

I was hoping it would work with either one as it is using equals() for comparison and AffinityKey calls the keys hash/equals method.

I guess I have to keep the AffinityKeys stored somewhere to make it work.

Thanks

Mikael


Den 2017-11-26 kl. 21:36, skrev Gaurav Bajaj:
Hi,

You have to alwaya use affinity key to access the Cache for any get, put, remove operation you do. Key should be exactly same as you used to put value else it won't be able to find it.

Thanks,
Gaurav

On 26-Nov-2017 3:19 PM, "Mikael&quo= t; <mikae= l-aronsson@telia.com> wrote:
Hi!

If I do a cache.put( new AffinityKey( key, value), myvalue); and later on want to update the value, do I need do a:

cache.put( new AffinityKey( key, value), newvalue); or can I do:

cache.put( key, newvalue);

If I do a put on a value that is already in the cache using a "non" affinity key, will the existing affinity info= rmation on the key be lost of I don't use the AffinityKey everytime I update the cache ?




--001a1143b798f048e8055ef45198--