ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Lantukh <ilant...@gridgain.com>
Subject Re: affinityRun then invoke
Date Wed, 30 Aug 2017 14:59:06 GMT
Hi Matt,

In your case ignite.compute().affinityRun(...) is redundant - if you simply
call cache.invoke(...), it will send your EntryProcessor to the primary
node for the specified key, where it will be executed.

Hope this helps.

On Wed, Aug 30, 2017 at 4:39 PM, matt <goodieboy@gmail.com> wrote:

> I'm using @AffinityKeyMapped to ensure that all items of a particular
> field (the "parent" in my case) are processed on the same node. When I want
> to process an entree, I'm essentially doing ignite.compute().affinityRun("my-cache",
> key, () -> this::processEntry); where processEntry does: cache.invoke(key,
> (entry, args) -> { if( entry.exists() ){ modify(entry); } else {
> create(entry); } return true; }); Is this generally a valid way to deal
> with atomically updating entrees within a partitioned cache? Thanks, - Matt
> ------------------------------
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>



-- 
Best regards,
Ilya

Mime
View raw message