Class CacheLazyEntry<K,V>
- java.lang.Object
-
- org.apache.ignite.cache.CacheInterceptorEntry<K,V>
-
- org.apache.ignite.internal.processors.cache.CacheLazyEntry<K,V>
-
- All Implemented Interfaces:
javax.cache.Cache.Entry<K,V>
- Direct Known Subclasses:
CacheInvokeEntry
public class CacheLazyEntry<K,V> extends CacheInterceptorEntry<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected GridCacheContextcctxCache context.protected KkeyKey.protected KeyCacheObjectkeyObjKey cache object.protected VvalValue.protected CacheObjectvalObjCache object value.
-
Constructor Summary
Constructors Constructor Description CacheLazyEntry(GridCacheContext ctx, KeyCacheObject keyObj, K key, CacheObject valObj, V val, boolean keepBinary)CacheLazyEntry(GridCacheContext ctx, KeyCacheObject keyObj, K key, CacheObject valObj, V val, boolean keepBinary, Long updateCntr)CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary)CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KgetKey()longgetPartitionUpdateCounter()Each cache update increases partition counter.VgetValue()VgetValue(boolean keepBinary)Returns the value stored in the cache when this entry was created.booleankeepBinary()Kkey()StringtoString()<T> Tunwrap(Class<T> cls)voidupdateCounter(long updateCntr)Sets update counter.Vvalue()
-
-
-
Field Detail
-
cctx
protected final GridCacheContext cctx
Cache context.
-
keyObj
protected KeyCacheObject keyObj
Key cache object.
-
valObj
protected CacheObject valObj
Cache object value.
-
key
@GridToStringInclude(sensitive=true) protected K key
Key.
-
val
@GridToStringInclude(sensitive=true) protected V val
Value.
-
-
Constructor Detail
-
CacheLazyEntry
public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary)
- Parameters:
cctx- Cache context.keyObj- Key cache object.valObj- Cache object value.keepBinary- Keep binary flag.
-
CacheLazyEntry
public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary)
- Parameters:
keyObj- Key cache object.val- Value.keepBinary- Keep binary flag.cctx- Cache context.
-
CacheLazyEntry
public CacheLazyEntry(GridCacheContext ctx, KeyCacheObject keyObj, K key, CacheObject valObj, V val, boolean keepBinary)
- Parameters:
ctx- Cache context.keyObj- Key cache object.key- Key value.valObj- Cache objectkeepBinary- Keep binary flag.val- Cache value.
-
CacheLazyEntry
public CacheLazyEntry(GridCacheContext ctx, KeyCacheObject keyObj, K key, CacheObject valObj, V val, boolean keepBinary, Long updateCntr)
- Parameters:
ctx- Cache context.keyObj- Key cache object.key- Key value.valObj- Cache objectkeepBinary- Keep binary flag.updateCntr- Partition update counter.val- Cache value.
-
-
Method Detail
-
getKey
public K getKey()
-
getValue
public V getValue()
-
getValue
public V getValue(boolean keepBinary)
Returns the value stored in the cache when this entry was created.- Parameters:
keepBinary- Flag to keep binary if needed.- Returns:
- the value corresponding to this entry
-
value
public V value()
- Returns:
- Return value. This methods doesn't initialize value.
-
key
public K key()
- Returns:
- Return key. This methods doesn't initialize key.
-
keepBinary
public boolean keepBinary()
- Returns:
- Keep binary flag.
-
getPartitionUpdateCounter
public long getPartitionUpdateCounter()
Each cache update increases partition counter. The same cache updates have on the same value of counter on primary and backup nodes. This value can be useful to communicate with external applications. The value has sense only for entries get byCacheInterceptor.onAfterPut(Cache.Entry)andCacheInterceptor.onAfterRemove(Cache.Entry)methods. For entries got by other methods will return0.- Specified by:
getPartitionUpdateCounterin classCacheInterceptorEntry<K,V>- Returns:
- Value of counter for this entry.
-
updateCounter
public void updateCounter(long updateCntr)
Sets update counter.- Parameters:
updateCntr- Update counter.
-
unwrap
public <T> T unwrap(Class<T> cls)
-
-