org.apache.ignite.internal.processors.cache

## Class GridCacheMapEntry

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMapEntry

All Implemented Interfaces:
  GridCacheEntryEx

Direct Known Subclasses:
  GridDistributedCacheEntry, GridLocalCacheEntry

    public abstract class GridCacheMapEntry
    extends Object
    implements GridCacheEntryEx

Adapter for cache entry.

### Field Summary

Fields
`static GridCacheAtomicVersionComparator` `ATOMIC_VER_COMPARATOR`
`protected GridCacheContext<?,?>` `cctx` Cache registry.
`protected byte` `flags` Flags: Deleted flag - mask `IS_DELETED_MASK` Unswapped flag - mask `IS_UNSWAPPED_MASK`
`protected KeyCacheObject` `key` Key.
`protected static IgniteLogger` `log` Logger.
`protected static AtomicReference<IgniteLogger>` `logRef` Static logger to avoid re-creation.
`protected long` `startVer` Start version.
`protected CacheObject` `val` Value.
`protected GridCacheVersion` `ver` Version.

### Constructor Summary

Constructors
`protected` `GridCacheMapEntry(GridCacheContext<?,?> cctx, KeyCacheObject key, int hash, CacheObject val, GridCacheMapEntry next, int hdrId)`

### Method Summary

Methods
`<V1> V1` `addMeta(UUID name, V1 val)` Adds a new metadata.
`GridCacheMvccCandidate` `candidate(GridCacheVersion ver)` Gets lock candidate for given lock ID.
`GridCacheMvccCandidate` `candidate(UUID nodeId, long threadId)`
`protected void` `checkObsolete()`
`boolean` `clear(GridCacheVersion ver, boolean readers, CacheEntryPredicate[] filter)` Marks entry as obsolete and, if possible or required, removes it from swap storage.
`protected void` `clearIndex(CacheObject prevVal)` Clears index.
`protected void` `clearReader(UUID nodeId)`
`protected void` `clearReaders()`
`<K,V> GridCacheContext<K,V>` `context()`
`boolean` `deleted()` Note: this method works only for cache configured in ATOMIC mode or for cache that is data center replication target.
`protected boolean` `deletedUnlocked()`
`protected void` `deletedUnlocked(boolean deleted)`
`boolean` `detached()`
`boolean` `equals(Object o)`
`GridCacheBatchSwapEntry` `evictInBatchInternal(GridCacheVersion obsoleteVer)` Evicts entry when batch evict is performed.
`boolean` `evictInternal(boolean swap, GridCacheVersion obsoleteVer, CacheEntryPredicate[] filter)`
`long` `expireTime()`
`long` `expireTimeExtras()`
`long` `expireTimeUnlocked()`
`int` `hashCode()`
`boolean` `hasLockCandidate(GridCacheVersion ver)` Checks if the candidate is either owner or pending.
`boolean` `hasLockCandidate(long threadId)` Checks if the candidate is either owner or pending.
`boolean` `hasLockCandidateUnsafe(GridCacheVersion ver)`
`boolean` `hasMeta(UUID name)` Tests whether or not given metadata is set.
`protected boolean` `hasOffHeapPointer()`
`protected boolean` `hasReaders()`
`boolean` `hasValue()`
`protected boolean` `hasValueUnlocked()`
`GridCacheEntryInfo` `info()`
`boolean` `initialValue(CacheObject val, GridCacheVersion ver, long ttl, long expireTime, boolean preload, AffinityTopologyVersion topVer, GridDrType drType)` Sets new value if current version is `0`
`boolean` `initialValue(KeyCacheObject key, GridCacheSwapEntry unswapped)` Sets new value if current version is `0` using swap entry data.
`CacheObject` `innerGet(IgniteInternalTx tx, boolean readSwap, boolean readThrough, boolean failFast, boolean unmarshal, boolean updateMetrics, boolean evt, boolean tmp, UUID subjId, Object transformClo, String taskName, IgniteCacheExpiryPolicy expirePlc)`
`CacheObject` `innerReload()` Reloads entry from underlying storage.
`GridCacheUpdateTxResult` `innerRemove(IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, boolean writeThrough, boolean retval, boolean evt, boolean metrics, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, GridCacheVersion explicitVer, UUID subjId, String taskName)`
`GridCacheUpdateTxResult` `innerSet(IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, CacheObject val, boolean writeThrough, boolean retval, long ttl, boolean evt, boolean metrics, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, long drExpireTime, GridCacheVersion explicitVer, UUID subjId, String taskName)`

`GridCacheUpdateAtomicResult`

`innerUpdate(GridCacheVersion newVer, UUID evtNodeId, UUID affNodeId, GridCacheOperation op, Object writeObj, Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, boolean primary, boolean verCheck, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, long explicitTtl, long explicitExpireTime, GridCacheVersion conflictVer, boolean conflictResolve, boolean intercept, UUID subjId, String taskName)`

`GridTuple3<Boolean,Object,javax.cache.processor.EntryProcessorResult<Object>>`

`innerUpdateLocal(GridCacheVersion ver, GridCacheOperation op, Object writeObj, Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, javax.cache.expiry.ExpiryPolicy expiryPlc, boolean evt, boolean metrics, CacheEntryPredicate[] filter, boolean intercept, UUID subjId, String taskName)`
Update method for local cache in atomic mode.

`boolean` `invalidate(CacheEntryPredicate[] filter)` Invalidates this entry if it passes given filter.
`boolean` `invalidate(GridCacheVersion curVer, GridCacheVersion newVer)` Invalidates this entry.
`boolean` `isDht()`
`boolean` `isInternal()`
`boolean` `isLocal()`
`boolean` `isNear()`
`boolean` `isNew()` Checks if entry is new assuming lock is held externally.
`boolean` `isNewLocked()` Checks if entry is new while holding lock.
`protected boolean` `isOffHeapValuesOnly()`
`boolean` `isReplicated()`
`boolean` `isStartVersion()`
`KeyCacheObject` `key()`
`protected Object` `keyValue(boolean cpy)`
`GridCacheMvccCandidate` `localCandidate(long threadId)`
`Collection<GridCacheMvccCandidate>` `localCandidates(GridCacheVersion... exclude)` Gets all local candidates.
`GridCacheMvccCandidate` `localOwner()`
`boolean` `lockedBy(GridCacheVersion ver)`
`boolean` `lockedByAny(GridCacheVersion... exclude)`
`boolean` `lockedByThread()`
`boolean` `lockedByThread(long threadId)`
`boolean` `lockedByThread(long threadId, GridCacheVersion exclude)`
`boolean` `lockedByThreadUnsafe(long threadId)` Will not fail for removed entries.
`boolean` `lockedByUnsafe(GridCacheVersion ver)`
`boolean` `lockedLocally(GridCacheVersion lockVer)`
`boolean` `lockedLocallyByIdOrThread(GridCacheVersion lockVer, long threadId)`
`boolean` `lockedLocallyUnsafe(GridCacheVersion lockVer)`
`boolean` `markObsolete(GridCacheVersion ver)` Sets obsolete flag if possible.
`protected boolean` `markObsolete0(GridCacheVersion ver, boolean clear)` Note that `onMarkedObsolete()` should always be called after this method returns `true`.
`boolean` `markObsoleteIfEmpty(GridCacheVersion ver)` Sets obsolete flag if entry value is `null` or entry is expired and no locks are held.
`boolean` `markObsoleteVersion(GridCacheVersion ver)` Sets obsolete flag if entry version equals to `ver`.
`int` `memorySize()`
`<V1> V1` `meta(UUID name)` Gets metadata by name.
`protected GridCacheMvcc` `mvccExtras()`
`protected void` `mvccExtras(GridCacheMvcc mvcc)`
`boolean` `obsolete()`
`boolean` `obsolete(GridCacheVersion exclude)`
`boolean` `obsoleteOrDeleted()`
`GridCacheVersion` `obsoleteVersion()`
`protected GridCacheVersion` `obsoleteVersionExtras()`
`protected void` `obsoleteVersionExtras(GridCacheVersion obsoleteVer)`
`protected long` `offHeapPointer()`
`protected void` `offHeapPointer(long valPtr)`
`protected void` `onInvalidate()` Called when entry invalidated.
`void` `onMarkedObsolete()` This method should be called each time entry is marked obsolete other than by calling `GridCacheEntryEx.markObsolete(GridCacheVersion)`.
`boolean` `onTtlExpired(GridCacheVersion obsoleteVer)` Callback from ttl processor to cache entry indicating that entry is expired.
`void` `onUnlock()` Calls `GridDhtLocalPartition.onUnlock()` for this entry's partition.
`int` `partition()`
`boolean` `partitionValid()`
`CacheObject` `peek(boolean heap, boolean offheap, boolean swap, AffinityTopologyVersion topVer, IgniteCacheExpiryPolicy expiryPlc)` Peeks into entry without loading value or updating statistics.
`CacheObject` `peek(boolean heap, boolean offheap, boolean swap, IgniteCacheExpiryPolicy plc)` Peeks into entry without loading value or updating statistics.
`CacheObject` `peekVisibleValue()` Peeks value provided to public API entries and to entry filters.
`<V1> V1` `putMetaIfAbsent(UUID name, V1 val)` Adds given metadata value only if it was absent.
`long` `rawExpireTime()`
`CacheObject` `rawGet()`
`CacheObject` `rawGetOrUnmarshal(boolean tmp)`
`CacheObject` `rawGetOrUnmarshalUnlocked(boolean tmp)`
`CacheObject` `rawPut(CacheObject val, long ttl)`
`long` `rawTtl()`
`protected void` `readExternalMeta(ObjectInput in)` Convenience way for super-classes which implement `Externalizable` to serialize metadata.
`protected Object` `readThrough(IgniteInternalTx tx, KeyCacheObject key, boolean reload, UUID subjId, String taskName)`
`protected void` `recordNodeId(UUID nodeId, AffinityTopologyVersion topVer)`
`protected void` `releaseSwap()`
`Collection<GridCacheMvccCandidate>` `remoteMvccSnapshot(GridCacheVersion... exclude)` Gets all remote versions.
`<V1> V1` `removeMeta(UUID name)` Removes metadata by name.
`<V1> boolean` `removeMeta(UUID name, V1 val)` Removes metadata only if its current value is equal to `val` passed in.
`<V1> boolean` `replaceMeta(UUID name, V1 curVal, V1 newVal)` Replaces given metadata with new `newVal` value only if its current value is equal to `curVal`.
`protected CacheObject` `saveValueForIndexUnlocked()` This method will return current value only if clearIndex(V) will require previous value.
`long` `startVersion()`
`String` `toString()`
`long` `ttl()`
`protected void` `ttlAndExpireTimeExtras(long ttl, long expireTime)`
`long` `ttlExtras()`
`IgniteTxKey` `txKey()`
`CacheObject` `unswap()`
`CacheObject` `unswap(boolean needVal)` Unswaps an entry.
`protected void` `update(CacheObject val, long expireTime, long ttl, GridCacheVersion ver)`
`protected void` `updateIndex(CacheObject val, long expireTime, GridCacheVersion ver, CacheObject prevVal)` Updates cache index.
`void` `updateTtl(GridCacheVersion ver, long ttl)`
`boolean` `valid(AffinityTopologyVersion topVer)`
`protected void` `value(CacheObject val)` Sets entry value.
`CacheObject` `valueBytes()`
`CacheObject` `valueBytes(GridCacheVersion ver)` Gets cached serialized value bytes.
`protected IgniteBiTuple<byte[],Byte>` `valueBytes0()`
`protected CacheObject` `valueBytesUnlocked()`
`GridCacheVersion` `version()`
`GridCacheVersionedEntryEx` `versionedEntry()` Create versioned entry for this cache entry.
`boolean` `versionedValue(CacheObject val, GridCacheVersion curVer, GridCacheVersion newVer)` Sets new value if passed in version matches the current version (used for read-through only).
`boolean` `visitable(CacheEntryPredicate[] filter)`
`<K,V> javax.cache.Cache.Entry<K,V>` `wrap()` Wraps this map entry into cache entry.
`<K,V> EvictableEntry<K,V>` `wrapEviction()`
`<K,V> javax.cache.Cache.Entry<K,V>` `wrapLazyValue()` Wraps entry to an entry with lazy value get.
`<K,V> CacheVersionedEntryImpl<K,V>` `wrapVersioned()`
`protected void` `writeExternalMeta(ObjectOutput out)` Convenience way for super-classes which implement `Externalizable` to serialize metadata.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheEntryEx

`removeLock, tmLock, txUnlock`

### Field Detail

#### ATOMIC_VER_COMPARATOR

    public static final GridCacheAtomicVersionComparator ATOMIC_VER_COMPARATOR

#### logRef

    protected static final AtomicReference<IgniteLogger> logRef

Static logger to avoid re-creation. Made static for test purpose.

#### log

    protected static volatile IgniteLogger log

Logger.

#### cctx

    @GridToStringExclude
    protected final GridCacheContext<?,?> cctx

Cache registry.

#### key

    @GridToStringInclude
    protected final KeyCacheObject key

Key.

#### val

    @GridToStringInclude
    protected CacheObject val

Value.

#### startVer

    @GridToStringInclude
    protected final long startVer

Start version.

#### ver

    @GridToStringInclude
    protected GridCacheVersion ver

Version.

#### flags

    @GridToStringInclude
    protected byte flags

Flags:

- Deleted flag - mask `IS_DELETED_MASK`
- Unswapped flag - mask `IS_UNSWAPPED_MASK`

### Constructor Detail

#### GridCacheMapEntry

    protected GridCacheMapEntry(GridCacheContext<?,?> cctx,
                     KeyCacheObject key,
                     int hash,
                     CacheObject val,
                     GridCacheMapEntry next,
                     int hdrId)

Parameters:
  `cctx` - Cache context.
  `key` - Cache key.
  `hash` - Key hash value.
  `val` - Entry value.
  `next` - Next entry in the linked list.
  `hdrId` - Header id.

### Method Detail

#### startVersion

    public long startVersion()

Specified by:
  `startVersion` in interface `GridCacheEntryEx`
Returns:
  Start version.

#### value

    protected void value(@Nullable
             CacheObject val)

Sets entry value. If off-heap value storage is enabled, will serialize value to off-heap.

Parameters:
  `val` - Value to store.

#### valueBytesUnlocked

    protected CacheObject valueBytesUnlocked()

Returns:
  Value bytes.

#### memorySize

    public int memorySize()
                   throws IgniteCheckedException

Specified by:
  `memorySize` in interface `GridCacheEntryEx`
Returns:
  Memory size.
Throws:
  `IgniteCheckedException` - If failed.

#### isInternal

    public boolean isInternal()

Specified by:
  `isInternal` in interface `GridCacheEntryEx`
Returns:
  `True` if entry is internal cache entry.

#### isDht

    public boolean isDht()

Specified by:
  `isDht` in interface `GridCacheEntryEx`
Returns:
  `True` if DHT.

#### isLocal

    public boolean isLocal()

Specified by:
  `isLocal` in interface `GridCacheEntryEx`
Returns:
  `True` if local.

#### isNear

    public boolean isNear()

Specified by:
  `isNear` in interface `GridCacheEntryEx`
Returns:
  `True` if near.

#### isReplicated

    public boolean isReplicated()

Specified by:
  `isReplicated` in interface `GridCacheEntryEx`
Returns:
  `True` if replicated.

#### detached

    public boolean detached()

Specified by:
  `detached` in interface `GridCacheEntryEx`
Returns:
  `False` if entry belongs to cache map, `true` if this entry was created in colocated cache and node is not primary for this key.

#### context

    public <K,V> GridCacheContext<K,V> context()

Specified by:
  `context` in interface `GridCacheEntryEx`
Returns:
  Context.

#### isNew

    public boolean isNew()
                  throws GridCacheEntryRemovedException

Checks if entry is new assuming lock is held externally.

Specified by:
  `isNew` in interface `GridCacheEntryEx`
Returns:
  `True` if entry is new.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### isNewLocked

    public boolean isNewLocked()
                        throws GridCacheEntryRemovedException

Checks if entry is new while holding lock.

Specified by:
  `isNewLocked` in interface `GridCacheEntryEx`
Returns:
  `True` if entry is new.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### isStartVersion

    public boolean isStartVersion()

Returns:
  `True` if start version.

#### valid

    public boolean valid(AffinityTopologyVersion topVer)

Specified by:
  `valid` in interface `GridCacheEntryEx`
Parameters:
  `topVer` - Topology version where validation should be performed. When negative the latest available topology should be used.
Returns:
  Checks if value is valid.

#### partition

    public int partition()

Specified by:
  `partition` in interface `GridCacheEntryEx`
Returns:
  Partition ID.

#### partitionValid

    public boolean partitionValid()

Specified by:
  `partitionValid` in interface `GridCacheEntryEx`
Returns:
  `True` if partition is in valid.

#### info

    @Nullable
    public GridCacheEntryInfo info()

Specified by:
  `info` in interface `GridCacheEntryEx`
Returns:
  Entry info.

#### unswap

    public CacheObject unswap()
                       throws IgniteCheckedException

Specified by:
  `unswap` in interface `GridCacheEntryEx`
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed to read from swap storage.

#### unswap

    @Nullable
    public CacheObject unswap(boolean needVal)
                       throws IgniteCheckedException

Unswaps an entry.

Specified by:
  `unswap` in interface `GridCacheEntryEx`
Parameters:
  `needVal` - If `false` then do not to deserialize value during unswap.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### valueBytes0

    protected IgniteBiTuple<byte[],Byte> valueBytes0()

Returns:
  Value bytes and flag indicating whether value is byte array.

#### releaseSwap

    protected final void releaseSwap()
                              throws IgniteCheckedException

Throws:
  `IgniteCheckedException` - If failed.

#### readThrough

    @Nullable
    protected Object readThrough(@Nullable
                              IgniteInternalTx tx,
                              KeyCacheObject key,
                              boolean reload,
                              UUID subjId,
                              String taskName)
                          throws IgniteCheckedException

Parameters:
  `tx` - Transaction.
  `key` - Key.
  `reload` - flag.
  `subjId` - Subject ID.
  `taskName` - Task name.
Returns:
  Read value.
Throws:
  `IgniteCheckedException` - If failed.

#### innerGet

    @Nullable
    public final CacheObject innerGet(@Nullable
                                IgniteInternalTx tx,
                                boolean readSwap,
                                boolean readThrough,
                                boolean failFast,
                                boolean unmarshal,
                                boolean updateMetrics,
                                boolean evt,
                                boolean tmp,
                                UUID subjId,
                                Object transformClo,
                                String taskName,
                                @Nullable
                                IgniteCacheExpiryPolicy expirePlc)
                               throws IgniteCheckedException,
                                      GridCacheEntryRemovedException

Specified by:
  `innerGet` in interface `GridCacheEntryEx`
Parameters:
  `tx` - Ongoing transaction (possibly null).
  `readSwap` - Flag indicating whether to check swap memory.
  `readThrough` - Flag indicating whether to read through.
  `failFast` - If `true`, then throw `GridCacheFilterFailedException` if filter didn't pass.
  `unmarshal` - Unmarshal flag.
  `updateMetrics` - If `true` then metrics should be updated.
  `evt` - Flag to signal event notification.
  `tmp` - If `true` can return temporary instance which is valid while entry lock is held, temporary object can used for filter evaluation or transform closure execution and should not be returned to user.
  `subjId` - Subject ID initiated this read.
  `transformClo` - Transform closure to record event.
  `taskName` - Task name. together with getting the value is an atomic operation.
  `expirePlc` - Expiry policy.
Returns:
  Cached value.
Throws:
  `IgniteCheckedException` - If loading value failed.
  `GridCacheEntryRemovedException` - If entry was removed.

#### innerReload

    @Nullable
    public final CacheObject innerReload()
                                  throws IgniteCheckedException,
                                         GridCacheEntryRemovedException

Reloads entry from underlying storage.

Specified by:
  `innerReload` in interface `GridCacheEntryEx`
Returns:
  Reloaded value.
Throws:
  `IgniteCheckedException` - If reload failed.
  `GridCacheEntryRemovedException` - If entry has been removed.

#### recordNodeId

    protected void recordNodeId(UUID nodeId,
                    AffinityTopologyVersion topVer)

Parameters:
  `nodeId` - Node ID.

#### innerSet

    public final GridCacheUpdateTxResult innerSet(@Nullable
                                   IgniteInternalTx tx,
                                   UUID evtNodeId,
                                   UUID affNodeId,
                                   CacheObject val,
                                   boolean writeThrough,
                                   boolean retval,
                                   long ttl,
                                   boolean evt,
                                   boolean metrics,
                                   AffinityTopologyVersion topVer,
                                   CacheEntryPredicate[] filter,
                                   GridDrType drType,
                                   long drExpireTime,
                                   @Nullable
                                   GridCacheVersion explicitVer,
                                   @Nullable
                                   UUID subjId,
                                   String taskName)
                                           throws IgniteCheckedException,
                                                  GridCacheEntryRemovedException

Specified by:
  `innerSet` in interface `GridCacheEntryEx`
Parameters:
  `tx` - Cache transaction.
  `evtNodeId` - ID of node responsible for this change.
  `affNodeId` - Partitioned node iD.
  `val` - Value to set.
  `writeThrough` - If `true` then persist to storage.
  `retval` - `True` if value should be returned (and unmarshalled if needed).
  `ttl` - Time to live.
  `evt` - Flag to signal event notification.
  `metrics` - Flag to signal metrics update.
  `topVer` - Topology version.
  `filter` - Filter.
  `drType` - DR type.
  `drExpireTime` - DR expire time (if any).
  `explicitVer` - Explicit version (if any).
  `subjId` - Subject ID initiated this update.
  `taskName` - Task name.
Returns:
  Tuple containing success flag and old value. If success is `false`, then value is `null`.
Throws:
  `IgniteCheckedException` - If storing value failed.
  `GridCacheEntryRemovedException` - If entry has been removed.

#### keyValue

    protected Object keyValue(boolean cpy)

Parameters:
  `cpy` - Copy flag.
Returns:
  Key value.

#### innerRemove

    public final GridCacheUpdateTxResult innerRemove(@Nullable
                                      IgniteInternalTx tx,
                                      UUID evtNodeId,
                                      UUID affNodeId,
                                      boolean writeThrough,
                                      boolean retval,
                                      boolean evt,
                                      boolean metrics,
                                      AffinityTopologyVersion topVer,
                                      CacheEntryPredicate[] filter,
                                      GridDrType drType,
                                      @Nullable
                                      GridCacheVersion explicitVer,
                                      @Nullable
                                      UUID subjId,
                                      String taskName)
                                              throws IgniteCheckedException,
                                                     GridCacheEntryRemovedException

Specified by:
  `innerRemove` in interface `GridCacheEntryEx`
Parameters:
  `tx` - Cache transaction.
  `evtNodeId` - ID of node responsible for this change.
  `affNodeId` - Partitioned node iD.
  `writeThrough` - If `true`, persist to the storage.
  `retval` - `True` if value should be returned (and unmarshalled if needed).
  `evt` - Flag to signal event notification.
  `metrics` - Flag to signal metrics notification.
  `topVer` - Topology version.
  `filter` - Filter.
  `drType` - DR type.
  `explicitVer` - Explicit version (if any).
  `subjId` - Subject ID initiated this update.
  `taskName` - Task name.
Returns:
  Tuple containing success flag and old value. If success is `false`, then value is `null`.
Throws:
  `IgniteCheckedException` - If remove failed.
  `GridCacheEntryRemovedException` - If entry has been removed.

#### innerUpdateLocal

    public GridTuple3<Boolean,Object,javax.cache.processor.EntryProcessorResult<Object>> innerUpdateLocal(GridCacheVersion ver,
                                                                                                 GridCacheOperation op,
                                                                                                 @Nullable
                                                                                                 Object writeObj,
                                                                                                 @Nullable
                                                                                                 Object[] invokeArgs,
                                                                                                 boolean writeThrough,
                                                                                                 boolean readThrough,
                                                                                                 boolean retval,
                                                                                                 @Nullable
                                                                                                 javax.cache.expiry.ExpiryPolicy expiryPlc,
                                                                                                 boolean evt,
                                                                                                 boolean metrics,
                                                                                                 @Nullable
                                                                                                 CacheEntryPredicate[] filter,
                                                                                                 boolean intercept,
                                                                                                 @Nullable
                                                                                                 UUID subjId,
                                                                                                 String taskName)
                                                                                                   throws IgniteCheckedException,
                                                                                                          GridCacheEntryRemovedException

Update method for local cache in atomic mode.

Specified by:
  `innerUpdateLocal` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Cache version.
  `op` - Operation.
  `writeObj` - Value. Type depends on operation.
  `invokeArgs` - Optional arguments for EntryProcessor.
  `writeThrough` - Write through flag.
  `readThrough` - Read through flag.
  `retval` - Return value flag.
  `expiryPlc` - Expiry policy..
  `evt` - Event flag.
  `metrics` - Metrics update flag.
  `filter` - Optional filter to check.
  `intercept` - If `true` then calls cache interceptor.
  `subjId` - Subject ID initiated this update.
  `taskName` - Task name.
Returns:
  Tuple containing success flag, old value and result for invoke operation.
Throws:
  `IgniteCheckedException` - If update failed.
  `GridCacheEntryRemovedException` - If entry is obsolete.

#### innerUpdate

    public GridCacheUpdateAtomicResult innerUpdate(GridCacheVersion newVer,
                                          UUID evtNodeId,
                                          UUID affNodeId,
                                          GridCacheOperation op,
                                          @Nullable
                                          Object writeObj,
                                          @Nullable
                                          Object[] invokeArgs,
                                          boolean writeThrough,
                                          boolean readThrough,
                                          boolean retval,
                                          @Nullable
                                          IgniteCacheExpiryPolicy expiryPlc,
                                          boolean evt,
                                          boolean metrics,
                                          boolean primary,
                                          boolean verCheck,
                                          AffinityTopologyVersion topVer,
                                          @Nullable
                                          CacheEntryPredicate[] filter,
                                          GridDrType drType,
                                          long explicitTtl,
                                          long explicitExpireTime,
                                          @Nullable
                                          GridCacheVersion conflictVer,
                                          boolean conflictResolve,
                                          boolean intercept,
                                          @Nullable
                                          UUID subjId,
                                          String taskName)
                                            throws IgniteCheckedException,
                                                   GridCacheEntryRemovedException,
                                                   GridClosureException

Specified by:
  `innerUpdate` in interface `GridCacheEntryEx`
Parameters:
  `newVer` - Cache version to set. Entry will be updated only if current version is less then passed version.
  `evtNodeId` - Event node ID.
  `affNodeId` - Affinity node ID.
  `op` - Update operation.
  `writeObj` - Value. Type depends on operation.
  `invokeArgs` - Optional arguments for entry processor.
  `writeThrough` - Write through flag.
  `readThrough` - Read through flag.
  `retval` - Return value flag.
  `expiryPlc` - Expiry policy.
  `evt` - Event flag.
  `metrics` - Metrics update flag.
  `primary` - If update is performed on primary node (the one which assigns version).
  `verCheck` - Whether update should check current version and ignore update if current version is greater than passed in.
  `filter` - Optional filter to check.
  `drType` - DR type.
  `explicitTtl` - Conflict TTL (if any).
  `explicitExpireTime` - Conflict expire time (if any).
  `conflictVer` - DR version (if any).
  `conflictResolve` - If `true` then performs conflicts resolution.
  `intercept` - If `true` then calls cache interceptor.
  `subjId` - Subject ID initiated this update.
  `taskName` - Task name.
Returns:
  Tuple where first value is flag showing whether operation succeeded, second value is old entry value if return value is requested, third is updated entry value, fourth is the version to enqueue for deferred delete the fifth is DR conflict context or `null` if conflict resolution was not performed, the last boolean - whether update should be propagated to backups or not.
Throws:
  `IgniteCheckedException` - If update failed.
  `GridCacheEntryRemovedException` - If entry is obsolete.
  `GridClosureException`

#### hasReaders

    protected boolean hasReaders()
                          throws GridCacheEntryRemovedException

Returns:
  `true` if entry has readers. It makes sense only for dht entry.
Throws:
  `GridCacheEntryRemovedException` - If removed.

#### clearReaders

    protected void clearReaders()

#### clearReader

    protected void clearReader(UUID nodeId)
                        throws GridCacheEntryRemovedException

Parameters:
  `nodeId` - Node ID to clear.
Throws:
  `GridCacheEntryRemovedException` - If removed.

#### clear

    public boolean clear(GridCacheVersion ver,
                boolean readers,
                @Nullable
                CacheEntryPredicate[] filter)
                  throws IgniteCheckedException

Marks entry as obsolete and, if possible or required, removes it from swap storage.

Specified by:
  `clear` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Obsolete version.
  `readers` - Flag to clear readers as well.
  `filter` - Optional entry filter.
Returns:
  `True` if entry was not being used, passed the filter and could be removed.
Throws:
  `IgniteCheckedException` - If failed to remove from swap.

#### obsoleteVersion

    public GridCacheVersion obsoleteVersion()

Specified by:
  `obsoleteVersion` in interface `GridCacheEntryEx`
Returns:
  Not-null version if entry is obsolete.

#### markObsolete

    public boolean markObsolete(GridCacheVersion ver)

Sets obsolete flag if possible.

Specified by:
  `markObsolete` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Version to set as obsolete.
Returns:
  `True` if entry is obsolete, `false` if entry is still used by other threads or nodes.

#### markObsoleteIfEmpty

    public boolean markObsoleteIfEmpty(@Nullable
                              GridCacheVersion ver)
                                throws IgniteCheckedException

Sets obsolete flag if entry value is `null` or entry is expired and no locks are held.

Specified by:
  `markObsoleteIfEmpty` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Version to set as obsolete.
Returns:
  `True` if entry was marked obsolete.
Throws:
  `IgniteCheckedException` - If failed.

#### markObsoleteVersion

    public boolean markObsoleteVersion(GridCacheVersion ver)

Sets obsolete flag if entry version equals to `ver`.

Specified by:
  `markObsoleteVersion` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Version to compare with.
Returns:
  `True` if marked obsolete.

#### markObsolete0

    protected final boolean markObsolete0(GridCacheVersion ver,
                        boolean clear)

Note that `onMarkedObsolete()` should always be called after this method returns `true`.

Parameters:
  `ver` - Version.
  `clear` - `True` to clear.
Returns:
  `True` if entry is obsolete, `false` if entry is still used by other threads or nodes.

#### onMarkedObsolete

    public void onMarkedObsolete()

This method should be called each time entry is marked obsolete other than by calling `GridCacheEntryEx.markObsolete(GridCacheVersion)`.

Specified by:
  `onMarkedObsolete` in interface `GridCacheEntryEx`

#### obsolete

    public final boolean obsolete()

Specified by:
  `obsolete` in interface `GridCacheEntryEx`
Returns:
  `True` if entry is obsolete.

#### obsolete

    public final boolean obsolete(GridCacheVersion exclude)

Specified by:
  `obsolete` in interface `GridCacheEntryEx`
Parameters:
  `exclude` - Obsolete version to ignore.
Returns:
  `True` if obsolete version is not `null` and is not the passed in version.

#### invalidate

    public boolean invalidate(@Nullable
                     GridCacheVersion curVer,
                     GridCacheVersion newVer)
                       throws IgniteCheckedException

Invalidates this entry.

Specified by:
  `invalidate` in interface `GridCacheEntryEx`
Parameters:
  `curVer` - Current version to match (`null` means always match).
  `newVer` - New version to set.
Returns:
  `true` if entry is obsolete.
Throws:
  `IgniteCheckedException` - If swap could not be released.

#### onInvalidate

    protected void onInvalidate()

Called when entry invalidated.

#### invalidate

    public boolean invalidate(@Nullable
                     CacheEntryPredicate[] filter)
                       throws GridCacheEntryRemovedException,
                              IgniteCheckedException

Invalidates this entry if it passes given filter.

Specified by:
  `invalidate` in interface `GridCacheEntryEx`
Parameters:
  `filter` - Optional filter that entry should pass before invalidation.
Returns:
  `true` if entry was actually invalidated.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.
  `IgniteCheckedException` - If swap could not be released.

#### update

    protected final void update(@Nullable
              CacheObject val,
              long expireTime,
              long ttl,
              GridCacheVersion ver)

Parameters:
  `val` - New value.
  `expireTime` - Expiration time.
  `ttl` - Time to live.
  `ver` - Update version.

#### isOffHeapValuesOnly

    protected boolean isOffHeapValuesOnly()

Returns:
  `True` if values should be stored off-heap.

#### checkObsolete

    protected void checkObsolete()
                          throws GridCacheEntryRemovedException

Throws:
  `GridCacheEntryRemovedException` - If entry is obsolete.

#### key

    public KeyCacheObject key()

Specified by:
  `key` in interface `GridCacheEntryEx`
Returns:
  Key.

#### txKey

    public IgniteTxKey txKey()

Specified by:
  `txKey` in interface `GridCacheEntryEx`
Returns:
  Transaction key.

#### version

    public GridCacheVersion version()
                             throws GridCacheEntryRemovedException

Specified by:
  `version` in interface `GridCacheEntryEx`
Returns:
  Version.
Throws:
  `GridCacheEntryRemovedException` - If entry has been removed.

#### peek

    @Nullable
    public CacheObject peek(boolean heap,
                            boolean offheap,
                            boolean swap,
                            AffinityTopologyVersion topVer,
                            @Nullable
                            IgniteCacheExpiryPolicy expiryPlc)
                     throws GridCacheEntryRemovedException,
                            IgniteCheckedException

Peeks into entry without loading value or updating statistics.

Specified by:
  `peek` in interface `GridCacheEntryEx`
Parameters:
  `heap` - Read from heap flag.
  `offheap` - Read from offheap flag.
  `swap` - Read from swap flag.
  `topVer` - Topology version.
  `expiryPlc` - Expiry policy if TTL should be updated.
Returns:
  Value.
Throws:
  `GridCacheEntryRemovedException` - If entry has been removed.
  `IgniteCheckedException` - If failed.

#### peek

    @Nullable
    public CacheObject peek(boolean heap,
                            boolean offheap,
                            boolean swap,
                            @Nullable
                            IgniteCacheExpiryPolicy plc)
                     throws GridCacheEntryRemovedException,
                            IgniteCheckedException

Peeks into entry without loading value or updating statistics.

Specified by:
  `peek` in interface `GridCacheEntryEx`
Parameters:
  `heap` - Read from heap flag.
  `offheap` - Read from offheap flag.
  `swap` - Read from swap flag.
  `plc` - Expiry policy if TTL should be updated.
Returns:
  Value.
Throws:
  `GridCacheEntryRemovedException` - If entry has been removed.
  `IgniteCheckedException` - If failed.

#### rawGet

    public CacheObject rawGet()

Specified by:
  `rawGet` in interface `GridCacheEntryEx`
Returns:
  Value.

#### rawGetOrUnmarshal

    @Nullable
    public CacheObject rawGetOrUnmarshal(boolean tmp)
                                  throws IgniteCheckedException

Specified by:
  `rawGetOrUnmarshal` in interface `GridCacheEntryEx`
Parameters:
  `tmp` - If `true` can return temporary instance which is valid while entry lock is held, temporary object can used for filter evaluation or transform closure execution and should not be returned to user.
Returns:
  Value (unmarshalled if needed).
Throws:
  `IgniteCheckedException` - If failed.

#### rawGetOrUnmarshalUnlocked

    @Nullable
    public CacheObject rawGetOrUnmarshalUnlocked(boolean tmp)
                                          throws IgniteCheckedException

Parameters:
  `tmp` - If `true` can return temporary instance.
Returns:
  Value (unmarshalled if needed).
Throws:
  `IgniteCheckedException` - If failed.

#### hasValue

    public boolean hasValue()

Specified by:
  `hasValue` in interface `GridCacheEntryEx`
Returns:
  `True` if has value or value bytes.

#### hasValueUnlocked

    protected boolean hasValueUnlocked()

Returns:
  `True` if this entry has value.

#### rawPut

    public CacheObject rawPut(CacheObject val,
                     long ttl)

Specified by:
  `rawPut` in interface `GridCacheEntryEx`
Parameters:
  `val` - New value.
  `ttl` - Time to live.
Returns:
  Old value.

#### initialValue

    public boolean initialValue(CacheObject val,
                       GridCacheVersion ver,
                       long ttl,
                       long expireTime,
                       boolean preload,
                       AffinityTopologyVersion topVer,
                       GridDrType drType)
                         throws IgniteCheckedException,
                                GridCacheEntryRemovedException

Sets new value if current version is `0`

Specified by:
  `initialValue` in interface `GridCacheEntryEx`
Parameters:
  `val` - New value.
  `ver` - Version to use.
  `ttl` - Time to live.
  `expireTime` - Expiration time.
  `preload` - Flag indicating whether entry is being preloaded.
  `topVer` - Topology version.
  `drType` - DR type.
Returns:
  `True` if initial value was set.
Throws:
  `IgniteCheckedException` - In case of error.
  `GridCacheEntryRemovedException` - If entry was removed.

#### initialValue

    public boolean initialValue(KeyCacheObject key,
                       GridCacheSwapEntry unswapped)
                         throws IgniteCheckedException,
                                GridCacheEntryRemovedException

Sets new value if current version is `0` using swap entry data. Note that this method does not update cache index.

Specified by:
  `initialValue` in interface `GridCacheEntryEx`
Parameters:
  `key` - Key.
  `unswapped` - Swap entry to set entry state from.
Returns:
  `True` if initial value was set.
Throws:
  `IgniteCheckedException` - In case of error.
  `GridCacheEntryRemovedException` - If entry was removed.

#### versionedEntry

    public GridCacheVersionedEntryEx versionedEntry()
                                             throws IgniteCheckedException

Create versioned entry for this cache entry.

Specified by:
  `versionedEntry` in interface `GridCacheEntryEx`
Returns:
  Versioned entry.
Throws:
  `IgniteCheckedException` - In case of error.

#### versionedValue

    public boolean versionedValue(CacheObject val,
                         GridCacheVersion curVer,
                         GridCacheVersion newVer)
                           throws IgniteCheckedException,
                                  GridCacheEntryRemovedException

Sets new value if passed in version matches the current version (used for read-through only).

Specified by:
  `versionedValue` in interface `GridCacheEntryEx`
Parameters:
  `val` - New value.
  `curVer` - Version to match or `null` if match is not required.
  `newVer` - Version to set.
Returns:
  `True` if versioned matched.
Throws:
  `IgniteCheckedException` - If index could not be updated.
  `GridCacheEntryRemovedException` - If entry was removed.

#### hasLockCandidate

    public boolean hasLockCandidate(GridCacheVersion ver)
                             throws GridCacheEntryRemovedException

Checks if the candidate is either owner or pending.

Specified by:
  `hasLockCandidate` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Candidate version to check.
Returns:
  `True` if the candidate is either owner or pending.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### hasLockCandidate

    public boolean hasLockCandidate(long threadId)
                             throws GridCacheEntryRemovedException

Checks if the candidate is either owner or pending.

Specified by:
  `hasLockCandidate` in interface `GridCacheEntryEx`
Parameters:
  `threadId` - ThreadId.
Returns:
  `True` if the candidate is either owner or pending.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedByAny

    public boolean lockedByAny(GridCacheVersion... exclude)
                        throws GridCacheEntryRemovedException

Specified by:
  `lockedByAny` in interface `GridCacheEntryEx`
Parameters:
  `exclude` - Exclude versions.
Returns:
  `True` if lock is owned by any thread or node.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedByThread

    public boolean lockedByThread()
                           throws GridCacheEntryRemovedException

Specified by:
  `lockedByThread` in interface `GridCacheEntryEx`
Returns:
  `True` if lock is owned by current thread.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedLocally

    public boolean lockedLocally(GridCacheVersion lockVer)
                          throws GridCacheEntryRemovedException

Specified by:
  `lockedLocally` in interface `GridCacheEntryEx`
Parameters:
  `lockVer` - Lock ID to check.
Returns:
  `True` if lock is owned by candidate.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedByThread

    public boolean lockedByThread(long threadId,
                         GridCacheVersion exclude)
                           throws GridCacheEntryRemovedException

Specified by:
  `lockedByThread` in interface `GridCacheEntryEx`
Parameters:
  `threadId` - Thread ID to check.
  `exclude` - Version to exclude from check.
Returns:
  `True` if lock is owned by given thread.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedLocallyByIdOrThread

    public boolean lockedLocallyByIdOrThread(GridCacheVersion lockVer,
                                    long threadId)
                                      throws GridCacheEntryRemovedException

Specified by:
  `lockedLocallyByIdOrThread` in interface `GridCacheEntryEx`
Parameters:
  `lockVer` - Lock ID.
  `threadId` - Thread ID.
Returns:
  `True` if locked either locally or by thread.
Throws:
  `GridCacheEntryRemovedException` - If removed.

#### lockedByThread

    public boolean lockedByThread(long threadId)
                           throws GridCacheEntryRemovedException

Specified by:
  `lockedByThread` in interface `GridCacheEntryEx`
Parameters:
  `threadId` - Thread ID to check.
Returns:
  `True` if lock is owned by given thread.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedBy

    public boolean lockedBy(GridCacheVersion ver)
                     throws GridCacheEntryRemovedException

Specified by:
  `lockedBy` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Version to check for ownership.
Returns:
  `True` if owner has the specified version.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedByThreadUnsafe

    public boolean lockedByThreadUnsafe(long threadId)

Will not fail for removed entries.

Specified by:
  `lockedByThreadUnsafe` in interface `GridCacheEntryEx`
Parameters:
  `threadId` - Thread ID to check.
Returns:
  `True` if lock is owned by given thread.

#### lockedByUnsafe

    public boolean lockedByUnsafe(GridCacheVersion ver)

Specified by:
  `lockedByUnsafe` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Version to check for ownership.
Returns:
  `True` if owner has the specified version.

#### lockedLocallyUnsafe

    public boolean lockedLocallyUnsafe(GridCacheVersion lockVer)

Specified by:
  `lockedLocallyUnsafe` in interface `GridCacheEntryEx`
Parameters:
  `lockVer` - Lock ID to check.
Returns:
  `True` if lock is owned by candidate.

#### hasLockCandidateUnsafe

    public boolean hasLockCandidateUnsafe(GridCacheVersion ver)

Specified by:
  `hasLockCandidateUnsafe` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Lock version to check.
Returns:
  `True` if has candidate with given lock ID.

#### localCandidates

    public Collection<GridCacheMvccCandidate> localCandidates(GridCacheVersion... exclude)
                                                       throws GridCacheEntryRemovedException

Gets all local candidates.

Specified by:
  `localCandidates` in interface `GridCacheEntryEx`
Parameters:
  `exclude` - Versions to exclude from check.
Returns:
  All local candidates.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### remoteMvccSnapshot

    public Collection<GridCacheMvccCandidate> remoteMvccSnapshot(GridCacheVersion... exclude)

Gets all remote versions.

Specified by:
  `remoteMvccSnapshot` in interface `GridCacheEntryEx`
Parameters:
  `exclude` - Exclude version.
Returns:
  All remote versions minus the excluded ones, if any.

#### candidate

    @Nullable
    public GridCacheMvccCandidate candidate(GridCacheVersion ver)
                                     throws GridCacheEntryRemovedException

Gets lock candidate for given lock ID.

Specified by:
  `candidate` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Lock version.
Returns:
  Lock candidate for given ID.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### localCandidate

    public GridCacheMvccCandidate localCandidate(long threadId)
                                          throws GridCacheEntryRemovedException

Specified by:
  `localCandidate` in interface `GridCacheEntryEx`
Parameters:
  `threadId` - Thread ID.
Returns:
  Local candidate.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### candidate

    public GridCacheMvccCandidate candidate(UUID nodeId,
                                   long threadId)
                                     throws GridCacheEntryRemovedException

Specified by:
  `candidate` in interface `GridCacheEntryEx`
Parameters:
  `nodeId` - Node ID.
  `threadId` - Thread ID.
Returns:
  Candidate.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### localOwner

    public GridCacheMvccCandidate localOwner()
                                      throws GridCacheEntryRemovedException

Specified by:
  `localOwner` in interface `GridCacheEntryEx`
Returns:
  Local owner.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### rawExpireTime

    public long rawExpireTime()

Specified by:
  `rawExpireTime` in interface `GridCacheEntryEx`
Returns:
  Expire time, without accounting for transactions or removals.

#### expireTimeUnlocked

    public long expireTimeUnlocked()

Specified by:
  `expireTimeUnlocked` in interface `GridCacheEntryEx`
Returns:
  Expiration time. Does not check for entry obsolete flag.

#### onTtlExpired

    public boolean onTtlExpired(GridCacheVersion obsoleteVer)

Callback from ttl processor to cache entry indicating that entry is expired.

Specified by:
  `onTtlExpired` in interface `GridCacheEntryEx`
Parameters:
  `obsoleteVer` - Version to set obsolete if entry is expired.
Returns:
  `True` if this entry was obsolete or became obsolete as a result of this call.

#### rawTtl

    public long rawTtl()

Specified by:
  `rawTtl` in interface `GridCacheEntryEx`
Returns:
  Time to live, without accounting for transactions or removals.

#### expireTime

    public long expireTime()
                    throws GridCacheEntryRemovedException

Specified by:
  `expireTime` in interface `GridCacheEntryEx`
Returns:
  Expiration time.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### ttl

    public long ttl()
             throws GridCacheEntryRemovedException

Specified by:
  `ttl` in interface `GridCacheEntryEx`
Returns:
  Time to live.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### updateTtl

    public void updateTtl(@Nullable
                 GridCacheVersion ver,
                 long ttl)

Specified by:
  `updateTtl` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Version.
  `ttl` - Time to live.

#### valueBytes

    public CacheObject valueBytes()
                           throws GridCacheEntryRemovedException

Specified by:
  `valueBytes` in interface `GridCacheEntryEx`
Returns:
  Value bytes.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### valueBytes

    @Nullable
    public CacheObject valueBytes(@Nullable
                                  GridCacheVersion ver)
                           throws IgniteCheckedException,
                                  GridCacheEntryRemovedException

Gets cached serialized value bytes.

Specified by:
  `valueBytes` in interface `GridCacheEntryEx`
Parameters:
  `ver` - Version for which to get value bytes.
Returns:
  Serialized value bytes.
Throws:
  `IgniteCheckedException` - If serialization failed.
  `GridCacheEntryRemovedException` - If entry was removed.

#### updateIndex

    protected void updateIndex(@Nullable
                   CacheObject val,
                   long expireTime,
                   GridCacheVersion ver,
                   @Nullable
                   CacheObject prevVal)
                        throws IgniteCheckedException

Updates cache index.

Parameters:
  `val` - Value.
  `expireTime` - Expire time.
  `ver` - New entry version.
  `prevVal` - Previous value.
Throws:
  `IgniteCheckedException` - If update failed.

#### clearIndex

    protected void clearIndex(CacheObject prevVal)
                       throws IgniteCheckedException

Clears index.

Parameters:
  `prevVal` - Previous value (if needed for index update).
Throws:
  `IgniteCheckedException` - If failed.

#### saveValueForIndexUnlocked

    protected CacheObject saveValueForIndexUnlocked()
                                             throws IgniteCheckedException

This method will return current value only if clearIndex(V) will require previous value. If previous value is not required, this method will return `null`.

Returns:
  Previous value or `null`.
Throws:
  `IgniteCheckedException` - If failed to retrieve previous value.

#### wrap

    public <K,V> javax.cache.Cache.Entry<K,V> wrap()

Wraps this map entry into cache entry.

Specified by:
  `wrap` in interface `GridCacheEntryEx`
Returns:
  Wrapped entry.

#### wrapLazyValue

    public <K,V> javax.cache.Cache.Entry<K,V> wrapLazyValue()

Wraps entry to an entry with lazy value get.

Specified by:
  `wrapLazyValue` in interface `GridCacheEntryEx`
Returns:
  Entry.

#### peekVisibleValue

    @Nullable
    public CacheObject peekVisibleValue()

Peeks value provided to public API entries and to entry filters.

Specified by:
  `peekVisibleValue` in interface `GridCacheEntryEx`
Returns:
  Value.

#### wrapEviction

    public <K,V> EvictableEntry<K,V> wrapEviction()

Specified by:
  `wrapEviction` in interface `GridCacheEntryEx`
Returns:
  Entry which is safe to pass into eviction policy.

#### wrapVersioned

    public <K,V> CacheVersionedEntryImpl<K,V> wrapVersioned()

Specified by:
  `wrapVersioned` in interface `GridCacheEntryEx`
Returns:
  Entry which holds key and version (no value, since entry is intended to be used in sync evictions checks).

#### evictInternal

    public boolean evictInternal(boolean swap,
                        GridCacheVersion obsoleteVer,
                        @Nullable
                        CacheEntryPredicate[] filter)
                          throws IgniteCheckedException

Specified by:
  `evictInternal` in interface `GridCacheEntryEx`
Parameters:
  `swap` - Swap flag.
  `obsoleteVer` - Version for eviction.
  `filter` - Optional filter.
Returns:
  `True` if entry could be evicted.
Throws:
  `IgniteCheckedException` - In case of error.

#### evictInBatchInternal

    public GridCacheBatchSwapEntry evictInBatchInternal(GridCacheVersion obsoleteVer)
                                                 throws IgniteCheckedException

Evicts entry when batch evict is performed. When called, does not write entry data to swap, but instead returns batch swap entry if entry was marked obsolete.

Specified by:
  `evictInBatchInternal` in interface `GridCacheEntryEx`
Parameters:
  `obsoleteVer` - Version to mark obsolete with.
Returns:
  Swap entry if this entry was marked obsolete, `null` if entry was not evicted.
Throws:
  `IgniteCheckedException` - If failed.

#### visitable

    public boolean visitable(CacheEntryPredicate[] filter)

Parameters:
  `filter` - Entry filter.
Returns:
  `True` if entry is visitable.

#### addMeta

    @Nullable
    public <V1> V1 addMeta(UUID name,
                           V1 val)

Adds a new metadata.

Specified by:
  `addMeta` in interface `GridCacheEntryEx`
Type Parameters:
  `V1` - Type of the value.
Parameters:
  `name` - Metadata name.
  `val` - Metadata value.
Returns:
  Metadata previously associated with given name, or `null` if there was none.

#### meta

    @Nullable
    public <V1> V1 meta(UUID name)

Gets metadata by name.

Specified by:
  `meta` in interface `GridCacheEntryEx`
Type Parameters:
  `V1` - Type of the value.
Parameters:
  `name` - Metadata name.
Returns:
  Metadata value or `null`.

#### removeMeta

    @Nullable
    public <V1> V1 removeMeta(UUID name)

Removes metadata by name.

Specified by:
  `removeMeta` in interface `GridCacheEntryEx`
Type Parameters:
  `V1` - Type of the value.
Parameters:
  `name` - Name of the metadata to remove.
Returns:
  Value of removed metadata or `null`.

#### removeMeta

    public <V1> boolean removeMeta(UUID name,
                          V1 val)

Removes metadata only if its current value is equal to `val` passed in.

Specified by:
  `removeMeta` in interface `GridCacheEntryEx`
Type Parameters:
  `V1` - Value type.
Parameters:
  `name` - Name of metadata attribute.
  `val` - Value to compare.
Returns:
  `True` if value was removed, `false` otherwise.

#### hasMeta

    public boolean hasMeta(UUID name)

Tests whether or not given metadata is set.

Specified by:
  `hasMeta` in interface `GridCacheEntryEx`
Parameters:
  `name` - Name of the metadata to test.
Returns:
  Whether or not given metadata is set.

#### putMetaIfAbsent

    @Nullable
    public <V1> V1 putMetaIfAbsent(UUID name,
                                   V1 val)

Adds given metadata value only if it was absent.

Specified by:
  `putMetaIfAbsent` in interface `GridCacheEntryEx`
Type Parameters:
  `V1` - Type of the value.
Parameters:
  `name` - Metadata name.
  `val` - Value to add if it's not attached already.
Returns:
  `null` if new value was put, or current value if put didn't happen.

#### replaceMeta

    public <V1> boolean replaceMeta(UUID name,
                           V1 curVal,
                           V1 newVal)

Replaces given metadata with new `newVal` value only if its current value is equal to `curVal`. Otherwise, it is no-op.

Specified by:
  `replaceMeta` in interface `GridCacheEntryEx`
Parameters:
  `name` - Name of the metadata.
  `curVal` - Current value to check.
  `newVal` - New value.
Returns:
  `true` if replacement occurred, `false` otherwise.

#### writeExternalMeta

    protected void writeExternalMeta(ObjectOutput out)
                              throws IOException

Convenience way for super-classes which implement `Externalizable` to serialize metadata. Super-classes must call this method explicitly from within `Externalizable.writeExternal(ObjectOutput)` methods implementation.

Parameters:
  `out` - Output to write to.
Throws:
  `IOException` - If I/O error occurred.

#### readExternalMeta

    protected void readExternalMeta(ObjectInput in)
                             throws IOException,
                                    ClassNotFoundException

Convenience way for super-classes which implement `Externalizable` to serialize metadata. Super-classes must call this method explicitly from within `Externalizable.readExternal(ObjectInput)` methods implementation.

Parameters:
  `in` - Input to read from.
Throws:
  `IOException` - If I/O error occurred.
  `ClassNotFoundException` - If some class could not be found.

#### deleted

    public boolean deleted()

Note: this method works only for cache configured in ATOMIC mode or for cache that is data center replication target.

Specified by:
  `deleted` in interface `GridCacheEntryEx`
Returns:
  `True` if entry has been already deleted.

#### obsoleteOrDeleted

    public boolean obsoleteOrDeleted()

Specified by:
  `obsoleteOrDeleted` in interface `GridCacheEntryEx`
Returns:
  `True` if entry is obsolete or deleted.
See Also:
  `GridCacheEntryEx.deleted()`

#### deletedUnlocked

    protected boolean deletedUnlocked()

Returns:
  `True` if deleted.

#### deletedUnlocked

    protected void deletedUnlocked(boolean deleted)

Parameters:
  `deleted` - `True` if deleted.

#### mvccExtras

    @Nullable
    protected GridCacheMvcc mvccExtras()

Returns:
  MVCC.

#### mvccExtras

    protected void mvccExtras(@Nullable
                  GridCacheMvcc mvcc)

Parameters:
  `mvcc` - MVCC.

#### obsoleteVersionExtras

    @Nullable
    protected GridCacheVersion obsoleteVersionExtras()

Returns:
  Obsolete version.

#### obsoleteVersionExtras

    protected void obsoleteVersionExtras(@Nullable
                             GridCacheVersion obsoleteVer)

Parameters:
  `obsoleteVer` - Obsolete version.

#### ttlExtras

    public long ttlExtras()

Returns:
  TTL.

#### expireTimeExtras

    public long expireTimeExtras()

Returns:
  Expire time.

#### ttlAndExpireTimeExtras

    protected void ttlAndExpireTimeExtras(long ttl,
                              long expireTime)

Parameters:
  `ttl` - TTL.
  `expireTime` - Expire time.

#### hasOffHeapPointer

    protected boolean hasOffHeapPointer()

Returns:
  True if entry has off-heap value pointer.

#### offHeapPointer

    protected long offHeapPointer()

Returns:
  Off-heap value pointer.

#### offHeapPointer

    protected void offHeapPointer(long valPtr)

Parameters:
  `valPtr` - Off-heap value pointer.

#### onUnlock

    public void onUnlock()

Calls `GridDhtLocalPartition.onUnlock()` for this entry's partition.

Specified by:
  `onUnlock` in interface `GridCacheEntryEx`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.2.0-incubating
Release Date | : June 16 2015