ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgenii Zhuravlev <e.zhuravlev...@gmail.com>
Subject Re: affinityRun then invoke
Date Wed, 30 Aug 2017 15:00:12 GMT
Hi,

It's not necessary to use affinityRun when you invoke EntryProcessor -
EntryProcessor allows for processing data directly on primary nodes.

I would recommend you to check this example: https://github.com/apache/
ignite/blob/master/examples/src/main/java/org/apache/
ignite/examples/datagrid/CacheEntryProcessorExample.java
It covers the simple use case of EntryProcessor, it will show you how
EntryProcessor should be used.

Evgenii


2017-08-30 16:39 GMT+03:00 matt <goodieboy@gmail.com>:

> 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.
>

Mime
View raw message