Hi Anand,

>In regards to your comment on cache will not get updated using invoke. How 
>do I ensure that the new computed value gets stored in the cache. 
>The first goal is to iterate through the cache and update a specific data 
>field in the cache in the fastest way possible. 
>The second goal is to - the cache has writethrough/writebehind enabled and 
>hence the updates will need to be propagated to the database as well. 

1. Just don't forget to call entry.setValue(val) at the final step of your
invoke() to store an updated value:

                            cache.invoke(key, (entry, args) -> { 
                                Fact val = entry.getValue(); 
                                // do some logic 
                                val.setAmount(val.getAmt1() +
val.getAmt2()); 
                                // save results
                                entry.setValue(val);
                                return val; 
                            }); 
It would not add any visible processing time.
You could try batch requests here with invokeAll() (as you have in your code
before) to achieve a better performance.

2. All such updates should be automatically propagated by Ignite to DB via
CacheStore if you have writethrough enabled.

Thanks,
Alexey



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to