public interface CacheEntry<K,V>
extends javax.cache.Cache.Entry<K,V>
Cache.Entry
by providing additional entry related information.
To get an instance of CacheEntry
use Cache.Entry.unwrap(Class)
method by passing
CacheEntry
class to it as the argument.
CacheEntry
is supported only for Cache.Entry
returned by one of the following methods:
Cache.invoke(Object, EntryProcessor, Object...)
Cache.invokeAll(Set, EntryProcessor, Object...)
IgniteCache
IgniteCache.randomEntry()
CacheEntry
is not supported for Cache.iterator()
because of performance reasons.
Cache.iterator()
loads entries from all the cluster nodes and to speed up the load additional
information, like entry's version, is ignored.
IgniteCachecache = grid(0).cache(null); CacheEntry entry1 = cache.invoke(100, new EntryProcessor >() { public CacheEntry process(MutableEntry entry, Object... arguments) throws EntryProcessorException { return entry.unwrap(CacheEntry.class); } }); // Cache entry for the given key may be updated at some point later. CacheEntry entry2 = cache.invoke(100, new EntryProcessor >() { public CacheEntry process(MutableEntry entry, Object... arguments) throws EntryProcessorException { return entry.unwrap(CacheEntry.class); } }); // Comparing entries' versions. if (entry1.version().compareTo(entry2.version()) < 0) { // the entry has been updated }
Modifier and Type | Method and Description |
---|---|
long |
updateTime()
Returns the time when the cache entry for the given key has been updated or initially created.
|
Comparable |
version()
Returns a comparable object representing the version of this cache entry.
|
Comparable version()
It is valid to compare cache entries' versions for the same key. In this case the latter update will be represented by a higher version. The result of versions comparison of cache entries of different keys is undefined.
long updateTime()
It is valid to compare cache entries' update time for the same key. In this case the latter update will be represented by higher update time. The result of update time comparison of cache entries of different keys is undefined.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.0.final Release Date : December 29 2015