[
https://jira.jboss.org/browse/ISPN-721?page=com.atlassian.jira.plugin.sys...
]
Manik Surtani commented on ISPN-721:
------------------------------------
In the case of an entry not being in memory, a cache.put() will cause:
1) load
2) store in memory
3) store
4) return value to user
and this can be better optimised as:
1) store value in memory, retrieve old value (ov1)
2) store in cache store, retrieve old value (ov2)
3) return (ov1 == null ? ov2 : ov1) to the user
saves a roundtrip to the cache store impl, You are right though that not all impls will
be able to really help here (many might just end up doing a load + store), so based on the
value of ov1 above, we should be able to ask the cache store not to bother with retrieving
the old value. But this needs thought, it isn't nearly fully baked. :-)
Change CacheStore.store() to return the previous value instead of
void.
-----------------------------------------------------------------------
Key: ISPN-721
URL:
https://jira.jboss.org/browse/ISPN-721
Project: Infinispan
Issue Type: Task
Components: Core API
Affects Versions: 4.2.0.Final
Reporter: Trustin Lee
Assignee: Trustin Lee
Fix For: 5.0.0.BETA1
Cache.put(key, value) operation returns a previous value. However, CacheStore.store()
does not return a previous value but void. To overcome the impedance mismatch, the
current implementation calls CacheStore.load() to simply get the previous value.
CacheStore.store() could be improved to reduce this unnecessary round trip.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira