Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-11-30 Thread Alexey Popov
Hi Anand, Ignite will collect a batch of updates for multiple operations if you enable write-behind. So, it will be done for entry.setvalue() within Cache.invoke for your case. And then Ignite will make a writeall() call for the batch. If your own CacheStore implementation does not override writ

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-11-28 Thread Anand Vijai
Hi Alexey, You are correct. I did not have my own CacheStore implementation. I am currently writing my own implementation and using the below when creating the cache: cfgAcct.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheJDBCAcctFactStore.class)); In the example code we are talking about, c

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-30 Thread Alexey Popov
Hi Anand, Can you share your CacheStore implementation? Do you use CacheStoreAdapter<>? Very probably you don't have your own "CacheStore.writeAll()" implementation that is used for batches. And the default one is used (it just sequentially calls "CacheStore.write()" for all entries in a batch).

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-27 Thread Anand Vijai
Thank you Alexei! I have configured my cache with the following properties: ccfg.setReadThrough(true); ccfg.setWriteThrough(true); ccfg.setWriteBehindEnabled(true); ccfg.setWriteBehindBatchSize(1); ccfg.setStoreKeepBinary(true); Even though the batch si

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-26 Thread Alexey Popov
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

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-25 Thread Anand Vijai
Hi Alexey, Thank you for the response. I changed my code based on your recommendation and i think with all the different options I was trying I ended up with a sub-par code! The below code does the update very fast (few secs) Collection res = ignite.compute().broadcast( ne

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-25 Thread Alexey Popov
Hi Anand, 1. Actually, you should broadcast your logic to all nodes via Ignite.compute() Please see the sample below: Collection res = ignite.compute().broadcast( new IgniteCallable() { /** Auto-inject ignite instance. */ @IgniteInstanceResource

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-25 Thread Andrey Mashenkov
Hi Anand, Sorry, I've mislooked you use scan query already. In your case you fetch data from grid and then try to make invoke for every batch of entries. I doubt invokeAll will give any speedup in this case comparing to simple put as you already have full value fetched in your hands. Why you won'

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-24 Thread Anand Vijai
Hi Andrew, I did try with the Iterator implementation using iterator.hasNext() (you can see that its commented in the code i shared) but the performance is only slightly higher (hence gave the range 10-100 keys per second) Do you want me to try to use a cursor explicitly instead of using an iter

Re: Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-24 Thread Andrey Mashenkov
Hi Anand, Looks like a cluster wide operation cache.size() performed on every iteration. Please, take a look how to iterating over cache entries via ScanQuery [1] . [1] https://apacheignite.readme.io/v2.2/docs/cache-queries#scan-queries On Tue, Oct 24, 2017 at 7:40 PM, Anand Vijai wrote: > I h

Retrieving keys very slow from a partitioned, no backup, no replicated cache

2017-10-24 Thread Anand Vijai
I have a cache with approx 1MM rows and is partitioned across 3 server nodes. I am trying to retrieve all the keys from the cache and then trying to perform an update operation using cache.invoke. The cache.invoke itself is very fast but the retrieval of the keys takes a lot of time - approximately