Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 40BFD18FB8 for ; Wed, 16 Dec 2015 15:21:32 +0000 (UTC) Received: (qmail 69279 invoked by uid 500); 16 Dec 2015 15:21:32 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 69238 invoked by uid 500); 16 Dec 2015 15:21:32 -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 69227 invoked by uid 99); 16 Dec 2015 15:21:31 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Dec 2015 15:21:31 +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 522ADC0178 for ; Wed, 16 Dec 2015 15:21:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.427 X-Spam-Level: ** X-Spam-Status: No, score=2.427 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id lsLYcsd6EZL7 for ; Wed, 16 Dec 2015 15:21:22 +0000 (UTC) Received: from SNT004-OMC3S24.hotmail.com (snt004-omc3s24.hotmail.com [65.55.90.163]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 9CA2942A70 for ; Wed, 16 Dec 2015 15:21:21 +0000 (UTC) Received: from SNT147-W15 ([65.55.90.137]) by SNT004-OMC3S24.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Wed, 16 Dec 2015 07:21:15 -0800 X-TMN: [qqml3CrwRIX1cXvPQb4Nuz7lH63oT/ne] X-Originating-Email: [andrewkornev@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_cce74096-e852-4f08-97cb-44b01d28c304_" From: Andrey Kornev To: "dev@ignite.apache.org" Subject: RE: Missing ways to get access to Ignite CacheEntry Date: Wed, 16 Dec 2015 07:21:15 -0800 Importance: Normal In-Reply-To: <56716314.3050803@gridgain.com> References: ,<56713E12.6000504@gridgain.com>,,<56716314.3050803@gridgain.com> MIME-Version: 1.0 X-OriginalArrivalTime: 16 Dec 2015 15:21:15.0404 (UTC) FILETIME=[67998CC0:01D13815] --_cce74096-e852-4f08-97cb-44b01d28c304_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Romain I suggest you be very careful using the invoke() functionality. As explaine= d in this posting (and the follow-ups) http://mail-archives.apache.org/mod_mbox/ignite-dev/201511.mbox/%3CSNT147-W= 14D2736E1374450B685721CF000%40phx.gbl%3E the correct usage of the invoke() may be difficult=2C to put it politely. @Denis Very briefly=2C the use case is "conditional re-compute". There is a= pretty expensive computation that needs to be applied to each entry on dem= and. The value is computed on first access and it is then cached along with= the current version of the cache entry. The value must be recomputed on = next access only if the entry has been modified.=20 If anyone has a better idea how to achieve something like that=2C please do= share! One constraint is that the computed value is not serializable. Cheers Andrey > Subject: Re: Missing ways to get access to Ignite CacheEntry > To: dev@ignite.apache.org > From: dmagda@gridgain.com > Date: Wed=2C 16 Dec 2015 16:11:48 +0300 >=20 > Romain=2C >=20 > If it's implemented this way for now it doesn't mean that we can't=20 > enhance the API for other use cases =3B) > As I said presently it's supported for limited number of methods mostly=20 > by performance reasons. >=20 > Please go ahead and try invoke/invokeAll and if it doesn't work fine for= =20 > you we can keep discussing what to do next. >=20 > Regards=2C > Denis >=20 > On 12/16/2015 1:53 PM=2C Romain Gilles wrote: > > Hi Denis=2C > > Thanks for you replay. And sorry to not double check it before. I see t= hat > > if I want to work with CacheEntry=2C I need to use the invoke method in= order > > to return the CacheEntry. This is the way I should do it. It sounds lik= e > > complicated for "just" getting an entry. But if you say this is the way= I > > will do it like that. I was just think that it could be a common use ca= se > > and therefore provide it as a shortcut. > > > > Thanks=2C > > > > Romain. > > > > Le mer. 16 d=E9c. 2015 =E0 11:34=2C Denis Magda a= =E9crit : > > > >> Hi Romain=2C > >> > >> As the current documentation of org.apache.ignite.cache.CacheEntry > >> states it's possible to get a reference to CacheEntry and its version > >> only for methods that are executed over local data set stored on a nod= e. > >> Among such methods are invoke & invokeAll and randomEntry. > >> > >> You probably can get a CacheEntry and its non null version when a cach= e > >> iterator is in use but the version will be 'null'=2C as far as I remem= ber=2C > >> for those entries that are loaded from remote nodes. > >> Presently Ignite doesn't transfer the version from remote nodes as a > >> part of response by perform reasons. > >> > >> Please elaborate more on your particular use case and what API you wou= ld > >> like to add in order to support it. > >> > >> -- > >> Denis > >> > >> On 12/16/2015 12:58 PM=2C Romain Gilles wrote: > >>> Hi Igniters=2C > >>> I'm looking for a way to get access to the Ignite CacheEntry. For now > >> this > >>> is the ways I found: > >>> > >>> - Through the queris > >>> - Through jsr 107 Cache Iterable > >>> - Through jsr 107 Cache itterator > >>> - Through IgniteCache::randomEntry() > >>> > >>> If I remember correctly it was possible to get the CacheEntry from a > >> given > >>> key in old version of gridgain community > >>> version: GridCacheProjection::entry(K key) GridCacheEntry > >>> I think it could be a good to introduce this feature at IgniteCache > >> level. > >>> Or maybe there is an other way to do it. > >>> > >>> Thanks=2C > >>> > >>> Romain. > >>> > >> >=20 = --_cce74096-e852-4f08-97cb-44b01d28c304_--