K
- the type of keys maintained by this cacheV
- the type of cached valuespublic static interface Cache.EntryProcessor<K,V,T>
Cache.Entry
mutations will not take effect till after the processor has completed;
if an exception is thrown inside the processor, the exception will be returned wrapped in an
CacheException
. No changes will be made to the cache.
This enables a way to perform compound operations without transactions
involving a cache entry atomically. Such operations may include mutations.
Implementations may process in situ, avoiding expensive network transfers. e.g. appending
to a list. Another is computing a function on a value and returning just that.
Cache.MutableEntry.setValue(Object)
is called in an EntryProcessor it is considered a put
for statistics purposes.
Cache.Entry.getKey()
is used and V if Cache.Entry.getValue()
is invoked.
In order to simplify placement of EntryProcessors in remote JVMs, arguments can be passed separately.
In such cases EntryProcessors do not need to be Serializable
.T process(Cache.MutableEntry<K,V> entry, Object... arguments)
entry
- the entryarguments
- a number of arguments to the process.Copyright © 2013. All Rights Reserved.