You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by user42 <ra...@mail.ru> on 2016/10/12 19:07:14 UTC

readThrough and localPeek(key)

Hello!
I use the affinity collocation feature and my code try to get the cache
local item .  My cache is configured for reading data from underlying
database if a item does not exist. (readThrough =true)

Something like this:
ignite.compute().affinityRun("myCache", companyId, () -> {
byte[] data = cache.localPeek(key).
...

But with the "localPeek" readThrough  does not work, it is works only with
"get(key)"
Is it a bug or a feature ? 

cache configuration:
PARTITIONED, OFFHEAP_TIERED, PRIMARY_SYNC, atomic, backups =0, swap
disabled.
Thanks,
User42



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/readThrough-and-localPeek-key-tp8243.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: readThrough and localPeek(key)

Posted by user42 <ra...@mail.ru>.
Thank you!



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/readThrough-and-localPeek-key-tp8243p8254.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: readThrough and localPeek(key)

Posted by vkulichenko <va...@gmail.com>.
Hi,

This is correct behavior. Peek goes only to cache by default, but you can
change this by providing custom CachePeekMode. Actually, this method is used
rarely for very specific use cases and I would recommend to use get()
instead, especially if your entries can be evicted from cache.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/readThrough-and-localPeek-key-tp8243p8252.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.