org.apache.ignite.internal.processors.cache

## Interface GridCacheEntryEx

All Known Implementing Classes:
  GridCacheMapEntry, GridDhtAtomicCacheEntry, GridDhtAtomicOffHeapCacheEntry, GridDhtCacheEntry, GridDhtColocatedCacheEntry, GridDhtColocatedOffHeapCacheEntry, GridDhtDetachedCacheEntry, GridDhtOffHeapCacheEntry, GridDistributedCacheEntry, GridLocalCacheEntry, GridNearCacheEntry, GridNearOffHeapCacheEntry

    public interface GridCacheEntryEx

Internal API for cache entry (`'Ex'` stands for extended).

### Method Summary

Methods
`<V> V` `addMeta(int key, V val)` Adds a new metadata.
`GridCacheMvccCandidate` `candidate(GridCacheVersion ver)` Gets lock candidate for given lock ID.
`GridCacheMvccCandidate` `candidate(UUID nodeId, long threadId)`
`boolean` `checkSerializableReadVersion(GridCacheVersion serReadVer)` Checks if there was read/write conflict in serializable transaction.
`boolean` `clear(GridCacheVersion ver, boolean readers)` Marks entry as obsolete and, if possible or required, removes it from swap storage.
`<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.
`boolean` `detached()`
`GridCacheBatchSwapEntry` `evictInBatchInternal(GridCacheVersion obsoleteVer)` Evicts entry when batch evict is performed.
`boolean` `evictInternal(boolean swap, GridCacheVersion obsoleteVer, CacheEntryPredicate[] filter)`
`long` `expireTime()`
`long` `expireTimeUnlocked()`
`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(int key)` Tests whether or not given metadata is set.
`boolean` `hasValue()`
`GridCacheEntryInfo` `info()`
`boolean` `initialValue(CacheObject val, GridCacheVersion ver, long ttl, long expireTime, boolean preload, AffinityTopologyVersion topVer, GridDrType drType, boolean fromStore)` 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(GridCacheVersion ver, IgniteInternalTx tx, boolean readSwap, boolean readThrough, boolean updateMetrics, boolean evt, boolean tmp, UUID subjId, Object transformClo, String taskName, IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary)`
`T2<CacheObject,GridCacheVersion>` `innerGetVersioned(GridCacheVersion ver, IgniteInternalTx tx, boolean readSwap, boolean unmarshal, boolean updateMetrics, boolean evt, UUID subjId, Object transformClo, String taskName, IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary)`
`CacheObject` `innerReload()` Reloads entry from underlying storage.
`GridCacheUpdateTxResult` `innerRemove(IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, boolean retval, boolean evt, boolean metrics, boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, GridCacheVersion explicitVer, UUID subjId, String taskName, GridCacheVersion dhtVer, Long updateCntr)`

`GridCacheUpdateTxResult`

`innerSet(IgniteInternalTx tx, UUID evtNodeId, UUID affNodeId, CacheObject val, boolean writeThrough, boolean retval, long ttl, boolean evt, boolean metrics, boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, long drExpireTime, GridCacheVersion explicitVer, UUID subjId, String taskName, GridCacheVersion dhtVer, Long updateCntr)`

`GridCacheUpdateAtomicResult`

`innerUpdate(GridCacheVersion ver, UUID evtNodeId, UUID affNodeId, GridCacheOperation op, Object val, Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, boolean keepBinary, IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, boolean primary, boolean checkVer, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, long conflictTtl, long conflictExpireTime, GridCacheVersion conflictVer, boolean conflictResolve, boolean intercept, UUID subjId, String taskName, CacheObject prevVal, Long updateCntr, GridDhtAtomicUpdateFuture fut)`

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

`innerUpdateLocal(GridCacheVersion ver, GridCacheOperation op, Object writeObj, Object[] invokeArgs, boolean writeThrough, boolean readThrough, boolean retval, boolean keepBinary, 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.
`boolean` `isReplicated()`
`KeyCacheObject` `key()`
`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.
`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()`
`<V> V` `meta(int key)` Gets metadata by key.
`boolean` `obsolete()`
`boolean` `obsolete(GridCacheVersion exclude)`
`boolean` `obsoleteOrDeleted()`
`GridCacheVersion` `obsoleteVersion()`
`void` `onMarkedObsolete()` This method should be called each time entry is marked obsolete other than by calling `markObsolete(GridCacheVersion)`.
`boolean` `onOffheapEvict(byte[] entry, GridCacheVersion evictVer, GridCacheVersion obsoleteVer)` Called when entry should be evicted from offheap.
`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 plc)` 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.
`<V> V` `putMetaIfAbsent(int key, V val)` Adds given metadata value only if it was absent.
`long` `rawExpireTime()`
`CacheObject` `rawGet()`
`CacheObject` `rawGetOrUnmarshal(boolean tmp)`
`CacheObject` `rawPut(CacheObject val, long ttl)`
`long` `rawTtl()`
`Collection<GridCacheMvccCandidate>` `remoteMvccSnapshot(GridCacheVersion... exclude)` Gets all remote versions.
`boolean` `removeLock(GridCacheVersion ver)`
`<V> V` `removeMeta(int key)` Removes metadata by key.
`<V> boolean` `removeMeta(int key, V val)` Removes metadata only if its current value is equal to `val` passed in.
`<V> boolean` `replaceMeta(int key, V curVal, V newVal)` Replaces given metadata with new `newVal` value only if its current value is equal to `curVal`.
`long` `startVersion()`
`boolean` `tmLock(IgniteInternalTx tx, long timeout, GridCacheVersion serOrder, GridCacheVersion serReadVer, boolean keepBinary)` This locks is called by transaction manager during prepare step for optimistic transactions.
`long` `ttl()`
`IgniteTxKey` `txKey()`
`void` `txUnlock(IgniteInternalTx tx)` Unlocks acquired lock.
`CacheObject` `unswap()`
`CacheObject` `unswap(boolean needVal)` Unswap ignoring flags.
`void` `updateTtl(GridCacheVersion ver, long ttl)`
`boolean` `valid(AffinityTopologyVersion topVer)`
`CacheObject` `valueBytes()`
`CacheObject` `valueBytes(GridCacheVersion ver)` Gets cached serialized value bytes.
`GridCacheVersion` `version()`
`<K,V> GridCacheVersionedEntryEx<K,V>` `versionedEntry(boolean keepBinary)` Create versioned entry for this cache entry.
`GridCacheVersion` `versionedValue(CacheObject val, GridCacheVersion curVer, GridCacheVersion newVer)` Sets new value if passed in version matches the current version (used for read-through only).
`<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(boolean keepBinary)` Wraps entry to an entry with lazy value get.
`<K,V> CacheEntryImplEx<K,V>` `wrapVersioned()`

### Method Detail

#### memorySize

    int memorySize()
                   throws IgniteCheckedException

Returns:
  Memory size.
Throws:
  `IgniteCheckedException` - If failed.

#### isInternal

    boolean isInternal()

Returns:
  `True` if entry is internal cache entry.

#### isDht

    boolean isDht()

Returns:
  `True` if DHT.

#### isNear

    boolean isNear()

Returns:
  `True` if near.

#### isReplicated

    boolean isReplicated()

Returns:
  `True` if replicated.

#### isLocal

    boolean isLocal()

Returns:
  `True` if local.

#### detached

    boolean detached()

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.

#### deleted

    boolean deleted()

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

Returns:
  `True` if entry has been already deleted.

#### context

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

Returns:
  Context.

#### partition

    int partition()

Returns:
  Partition ID.

#### startVersion

    long startVersion()

Returns:
  Start version.

#### key

    KeyCacheObject key()

Returns:
  Key.

#### txKey

    IgniteTxKey txKey()

Returns:
  Transaction key.

#### rawGet

    CacheObject rawGet()

Returns:
  Value.

#### rawGetOrUnmarshal

    CacheObject rawGetOrUnmarshal(boolean tmp)
                                  throws IgniteCheckedException

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.

#### hasValue

    boolean hasValue()

Returns:
  `True` if has value or value bytes.

#### rawPut

    CacheObject rawPut(CacheObject val,
                     long ttl)

Parameters:
  `val` - New value.
  `ttl` - Time to live.
Returns:
  Old value.

#### wrap

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

Wraps this map entry into cache entry.

Returns:
  Wrapped entry.

#### wrapLazyValue

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

Wraps entry to an entry with lazy value get.

Parameters:
  `keepBinary` - Keep binary flag.
Returns:
  Entry.

#### peekVisibleValue

    @Nullable
    CacheObject peekVisibleValue()

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

Returns:
  Value.

#### wrapEviction

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

Returns:
  Entry which is safe to pass into eviction policy.

#### wrapVersioned

    <K,V> CacheEntryImplEx<K,V> wrapVersioned()

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

#### obsoleteVersion

    GridCacheVersion obsoleteVersion()

Returns:
  Not-null version if entry is obsolete.

#### obsolete

    boolean obsolete()

Returns:
  `True` if entry is obsolete.

#### obsoleteOrDeleted

    boolean obsoleteOrDeleted()

Returns:
  `True` if entry is obsolete or deleted.
See Also:
  `deleted()`

#### obsolete

    boolean obsolete(GridCacheVersion exclude)

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

#### info

    @Nullable
    GridCacheEntryInfo info()

Returns:
  Entry info.

#### invalidate

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

Invalidates this entry.

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.

#### invalidate

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

Invalidates this entry if it passes given filter.

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

#### evictInternal

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

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

    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.

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.

#### onMarkedObsolete

    void onMarkedObsolete()

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

#### isNew

    boolean isNew()
                  throws GridCacheEntryRemovedException

Checks if entry is new assuming lock is held externally.

Returns:
  `True` if entry is new.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### isNewLocked

    boolean isNewLocked()
                        throws GridCacheEntryRemovedException

Checks if entry is new while holding lock.

Returns:
  `True` if entry is new.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### valid

    boolean valid(AffinityTopologyVersion topVer)

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

#### partitionValid

    boolean partitionValid()

Returns:
  `True` if partition is in valid.

#### innerGet

    @Nullable
    CacheObject innerGet(@Nullable
                                GridCacheVersion ver,
                                @Nullable
                                IgniteInternalTx tx,
                                boolean readSwap,
                                boolean readThrough,
                                boolean updateMetrics,
                                boolean evt,
                                boolean tmp,
                                UUID subjId,
                                Object transformClo,
                                String taskName,
                                @Nullable
                                IgniteCacheExpiryPolicy expiryPlc,
                                boolean keepBinary)
                         throws IgniteCheckedException,
                                GridCacheEntryRemovedException

Parameters:
  `ver` - Cache version to set. The version will be used on updating entry instead of generated one.
  `tx` - Ongoing transaction (possibly null).
  `readSwap` - Flag indicating whether to check swap memory.
  `readThrough` - Flag indicating whether to read through.
  `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.
  `expiryPlc` - Expiry policy.
  `keepBinary` - Keep binary flag.
Returns:
  Cached value.
Throws:
  `IgniteCheckedException` - If loading value failed.
  `GridCacheEntryRemovedException` - If entry was removed.

#### innerGetVersioned

    @Nullable
    T2<CacheObject,GridCacheVersion> innerGetVersioned(@Nullable
                                                              GridCacheVersion ver,
                                                              IgniteInternalTx tx,
                                                              boolean readSwap,
                                                              boolean unmarshal,
                                                              boolean updateMetrics,
                                                              boolean evt,
                                                              UUID subjId,
                                                              Object transformClo,
                                                              String taskName,
                                                              @Nullable
                                                              IgniteCacheExpiryPolicy expiryPlc,
                                                              boolean keepBinary)
                                                       throws IgniteCheckedException,
                                                              GridCacheEntryRemovedException

Parameters:
  `ver` - Cache version to set. The version will be used on updating entry instead of generated one.
  `tx` - Cache transaction.
  `readSwap` - Flag indicating whether to check swap memory.
  `unmarshal` - Unmarshal flag.
  `updateMetrics` - If `true` then metrics should be updated.
  `evt` - Flag to signal event notification.
  `subjId` - Subject ID initiated this read.
  `transformClo` - Transform closure to record event.
  `taskName` - Task name.
  `expiryPlc` - Expiry policy.
  `keepBinary` - Keep binary flag.
Returns:
  Cached value and entry version.
Throws:
  `IgniteCheckedException` - If loading value failed.
  `GridCacheEntryRemovedException` - If entry was removed.

#### innerReload

    @Nullable
    CacheObject innerReload()
                            throws IgniteCheckedException,
                                   GridCacheEntryRemovedException

Reloads entry from underlying storage.

Returns:
  Reloaded value.
Throws:
  `IgniteCheckedException` - If reload failed.
  `GridCacheEntryRemovedException` - If entry has been removed.

#### innerSet

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

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.
  `keepBinary` - Keep binary flag.
  `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.
  `dhtVer` - Dht version for near cache entry.
  `updateCntr` - Update counter.
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.

#### innerRemove

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

Parameters:
  `tx` - Cache transaction.
  `evtNodeId` - ID of node responsible for this change.
  `affNodeId` - Partitioned node iD.
  `retval` - `True` if value should be returned (and unmarshalled if needed).
  `evt` - Flag to signal event notification.
  `metrics` - Flag to signal metrics notification.
  `keepBinary` - Keep binary flag.
  `topVer` - Topology version.
  `filter` - Filter.
  `drType` - DR type.
  `explicitVer` - Explicit version (if any).
  `subjId` - Subject ID initiated this update.
  `taskName` - Task name.
  `dhtVer` - Dht version for near cache entry.
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.

#### innerUpdate

    GridCacheUpdateAtomicResult innerUpdate(GridCacheVersion ver,
                                          UUID evtNodeId,
                                          UUID affNodeId,
                                          GridCacheOperation op,
                                          @Nullable
                                          Object val,
                                          @Nullable
                                          Object[] invokeArgs,
                                          boolean writeThrough,
                                          boolean readThrough,
                                          boolean retval,
                                          boolean keepBinary,
                                          @Nullable
                                          IgniteCacheExpiryPolicy expiryPlc,
                                          boolean evt,
                                          boolean metrics,
                                          boolean primary,
                                          boolean checkVer,
                                          AffinityTopologyVersion topVer,
                                          @Nullable
                                          CacheEntryPredicate[] filter,
                                          GridDrType drType,
                                          long conflictTtl,
                                          long conflictExpireTime,
                                          @Nullable
                                          GridCacheVersion conflictVer,
                                          boolean conflictResolve,
                                          boolean intercept,
                                          @Nullable
                                          UUID subjId,
                                          String taskName,
                                          @Nullable
                                          CacheObject prevVal,
                                          @Nullable
                                          Long updateCntr,
                                          @Nullable
                                          GridDhtAtomicUpdateFuture fut)
                                            throws IgniteCheckedException,
                                                   GridCacheEntryRemovedException

Parameters:
  `ver` - 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.
  `val` - 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).
  `checkVer` - Whether update should check current version and ignore update if current version is greater than passed in.
  `topVer` - Topology version.
  `filter` - Optional filter to check.
  `drType` - DR type.
  `conflictTtl` - Conflict TTL (if any).
  `conflictExpireTime` - 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.
  `updateCntr` - Update counter.
  `fut` - Dht atomic future.
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.

#### innerUpdateLocal

    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,
                                                                                                 boolean keepBinary,
                                                                                                 @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.

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.

#### clear

    boolean clear(GridCacheVersion ver,
                boolean readers)
                  throws IgniteCheckedException

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

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

#### tmLock

    boolean tmLock(IgniteInternalTx tx,
                 long timeout,
                 @Nullable
                 GridCacheVersion serOrder,
                 @Nullable
                 GridCacheVersion serReadVer,
                 boolean keepBinary)
                   throws GridCacheEntryRemovedException,
                          GridDistributedLockCancelledException

This locks is called by transaction manager during prepare step for optimistic transactions.

Parameters:
  `tx` - Cache transaction.
  `timeout` - Timeout for lock acquisition.
  `serOrder` - Version for serializable transactions ordering.
  `serReadVer` - Optional read entry version for optimistic serializable transaction.
Returns:
  `True` if lock was acquired, `false` otherwise.
Throws:
  `GridCacheEntryRemovedException` - If this entry is obsolete.
  `GridDistributedLockCancelledException` - If lock has been cancelled.

#### txUnlock

    void txUnlock(IgniteInternalTx tx)
                  throws GridCacheEntryRemovedException

Unlocks acquired lock.

Parameters:
  `tx` - Cache transaction.
Throws:
  `GridCacheEntryRemovedException` - If this entry has been removed from cache.

#### removeLock

    boolean removeLock(GridCacheVersion ver)
                       throws GridCacheEntryRemovedException

Parameters:
  `ver` - Removes lock.
Returns:
  `True` If lock has been removed.
Throws:
  `GridCacheEntryRemovedException` - If this entry has been removed from cache.

#### markObsolete

    boolean markObsolete(GridCacheVersion ver)

Sets obsolete flag if possible.

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

    boolean markObsoleteIfEmpty(@Nullable
                              GridCacheVersion ver)
                                throws IgniteCheckedException

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

Parameters:
  `ver` - Version to set as obsolete.
Returns:
  `True` if entry was marked obsolete.
Throws:
  `IgniteCheckedException` - If failed.

#### markObsoleteVersion

    boolean markObsoleteVersion(GridCacheVersion ver)

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

Parameters:
  `ver` - Version to compare with.
Returns:
  `True` if marked obsolete.

#### version

    GridCacheVersion version()
                             throws GridCacheEntryRemovedException

Returns:
  Version.
Throws:
  `GridCacheEntryRemovedException` - If entry has been removed.

#### checkSerializableReadVersion

    boolean checkSerializableReadVersion(GridCacheVersion serReadVer)
                                         throws GridCacheEntryRemovedException

Checks if there was read/write conflict in serializable transaction.

Parameters:
  `serReadVer` - Version read in serializable transaction.
Returns:
  `True` if version check passed.
Throws:
  `GridCacheEntryRemovedException` - If entry has been removed.

#### peek

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

Peeks into entry without loading value or updating statistics.

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

#### peek

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

Peeks into entry without loading value or updating statistics.

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.

#### initialValue

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

Sets new value if current version is `0`

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.
  `fromStore` - `True` if value was loaded from store.
Returns:
  `True` if initial value was set.
Throws:
  `IgniteCheckedException` - In case of error.
  `GridCacheEntryRemovedException` - If entry was removed.

#### initialValue

    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.

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

    <K,V> GridCacheVersionedEntryEx<K,V> versionedEntry(boolean keepBinary)
                                                  throws IgniteCheckedException,
                                                         GridCacheEntryRemovedException

Create versioned entry for this cache entry.

Parameters:
  `keepBinary` - Keep binary flag.
Returns:
  Versioned entry.
Throws:
  `IgniteCheckedException` - In case of error.
  `GridCacheEntryRemovedException` - If entry was removed.

#### versionedValue

    GridCacheVersion versionedValue(CacheObject val,
                                  @Nullable
                                  GridCacheVersion curVer,
                                  @Nullable
                                  GridCacheVersion newVer)
                                    throws IgniteCheckedException,
                                           GridCacheEntryRemovedException

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

Parameters:
  `val` - New value.
  `curVer` - Version to match or `null` if match is not required.
  `newVer` - Version to set.
Returns:
  Non null version if value was set.
Throws:
  `IgniteCheckedException` - If index could not be updated.
  `GridCacheEntryRemovedException` - If entry was removed.

#### hasLockCandidate

    boolean hasLockCandidate(GridCacheVersion ver)
                             throws GridCacheEntryRemovedException

Checks if the candidate is either owner or pending.

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

#### hasLockCandidate

    boolean hasLockCandidate(long threadId)
                             throws GridCacheEntryRemovedException

Checks if the candidate is either owner or pending.

Parameters:
  `threadId` - ThreadId.
Returns:
  `True` if the candidate is either owner or pending.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedByAny

    boolean lockedByAny(GridCacheVersion... exclude)
                        throws GridCacheEntryRemovedException

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

#### lockedByThread

    boolean lockedByThread()
                           throws GridCacheEntryRemovedException

Returns:
  `True` if lock is owned by current thread.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### lockedLocallyByIdOrThread

    boolean lockedLocallyByIdOrThread(GridCacheVersion lockVer,
                                    long threadId)
                                      throws GridCacheEntryRemovedException

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

#### lockedLocally

    boolean lockedLocally(GridCacheVersion lockVer)
                          throws GridCacheEntryRemovedException

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

#### lockedByThread

    boolean lockedByThread(long threadId,
                         GridCacheVersion exclude)
                           throws GridCacheEntryRemovedException

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.

#### lockedByThread

    boolean lockedByThread(long threadId)
                           throws GridCacheEntryRemovedException

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

#### lockedBy

    boolean lockedBy(GridCacheVersion ver)
                     throws GridCacheEntryRemovedException

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

#### lockedByThreadUnsafe

    boolean lockedByThreadUnsafe(long threadId)

Will not fail for removed entries.

Parameters:
  `threadId` - Thread ID to check.
Returns:
  `True` if lock is owned by given thread.

#### lockedByUnsafe

    boolean lockedByUnsafe(GridCacheVersion ver)

Parameters:
  `ver` - Version to check for ownership.
Returns:
  `True` if owner has the specified version.

#### lockedLocallyUnsafe

    boolean lockedLocallyUnsafe(GridCacheVersion lockVer)

Parameters:
  `lockVer` - Lock ID to check.
Returns:
  `True` if lock is owned by candidate.

#### hasLockCandidateUnsafe

    boolean hasLockCandidateUnsafe(GridCacheVersion ver)

Parameters:
  `ver` - Lock version to check.
Returns:
  `True` if has candidate with given lock ID.

#### localCandidate

    @Nullable
    GridCacheMvccCandidate localCandidate(long threadId)
                                          throws GridCacheEntryRemovedException

Parameters:
  `threadId` - Thread ID.
Returns:
  Local candidate.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### localCandidates

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

Gets all local candidates.

Parameters:
  `exclude` - Versions to exclude from check.
Returns:
  All local candidates.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### remoteMvccSnapshot

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

Gets all remote versions.

Parameters:
  `exclude` - Exclude version.
Returns:
  All remote versions minus the excluded ones, if any.

#### candidate

    @Nullable
    GridCacheMvccCandidate candidate(GridCacheVersion ver)
                                     throws GridCacheEntryRemovedException

Gets lock candidate for given lock ID.

Parameters:
  `ver` - Lock version.
Returns:
  Lock candidate for given ID.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### candidate

    @Nullable
    GridCacheMvccCandidate candidate(UUID nodeId,
                                            long threadId)
                                     throws GridCacheEntryRemovedException

Parameters:
  `nodeId` - Node ID.
  `threadId` - Thread ID.
Returns:
  Candidate.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### localOwner

    @Nullable
    GridCacheMvccCandidate localOwner()
                                      throws GridCacheEntryRemovedException

Returns:
  Local owner.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### valueBytes

    CacheObject valueBytes()
                           throws GridCacheEntryRemovedException

Returns:
  Value bytes.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### valueBytes

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

Gets cached serialized value bytes.

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

#### rawExpireTime

    long rawExpireTime()

Returns:
  Expire time, without accounting for transactions or removals.

#### expireTime

    long expireTime()
                    throws GridCacheEntryRemovedException

Returns:
  Expiration time.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### expireTimeUnlocked

    long expireTimeUnlocked()

Returns:
  Expiration time. Does not check for entry obsolete flag.

#### onTtlExpired

    boolean onTtlExpired(GridCacheVersion obsoleteVer)
                         throws GridCacheEntryRemovedException

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

Parameters:
  `obsoleteVer` - Version to set obsolete if entry is expired.
Returns:
  `True` if this entry was expired as a result of this call.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### rawTtl

    long rawTtl()

Returns:
  Time to live, without accounting for transactions or removals.

#### ttl

    long ttl()
             throws GridCacheEntryRemovedException

Returns:
  Time to live.
Throws:
  `GridCacheEntryRemovedException` - If entry was removed.

#### updateTtl

    void updateTtl(@Nullable
                 GridCacheVersion ver,
                 long ttl)
                   throws GridCacheEntryRemovedException

Parameters:
  `ver` - Version.
  `ttl` - Time to live.
Throws:
  `GridCacheEntryRemovedException`

#### onOffheapEvict

    boolean onOffheapEvict(byte[] entry,
                         GridCacheVersion evictVer,
                         GridCacheVersion obsoleteVer)
                           throws IgniteCheckedException,
                                  GridCacheEntryRemovedException

Called when entry should be evicted from offheap.

If swap is enabled tries to do offheap -> swap eviction, otherwise evicted value should be passed to query manager.

Parameters:
  `entry` - Serialized swap entry.
  `evictVer` - Version when entry was selected for eviction.
  `obsoleteVer` - Obsolete version.
Returns:
  `True` if entry was obsoleted and written to swap.
Throws:
  `IgniteCheckedException` - If failed.
  `GridCacheEntryRemovedException` - If entry was removed.

#### unswap

    @Nullable
    CacheObject unswap()
                       throws IgniteCheckedException,
                              GridCacheEntryRemovedException

Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed to read from swap storage.
  `GridCacheEntryRemovedException` - If entry was removed.

#### unswap

    @Nullable
    CacheObject unswap(boolean needVal)
                       throws IgniteCheckedException,
                              GridCacheEntryRemovedException

Unswap ignoring flags.

Parameters:
  `needVal` - If `false` then do not need to deserialize value during unswap.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.
  `GridCacheEntryRemovedException` - If entry was removed.

#### hasMeta

    boolean hasMeta(int key)

Tests whether or not given metadata is set.

Parameters:
  `key` - Key of the metadata to test.
Returns:
  Whether or not given metadata is set.

#### meta

    @Nullable
    <V> V meta(int key)

Gets metadata by key.

Type Parameters:
  `V` - Type of the value.
Parameters:
  `key` - Metadata key.
Returns:
  Metadata value or `null`.

#### addMeta

    @Nullable
    <V> V addMeta(int key,
                         V val)

Adds a new metadata.

Type Parameters:
  `V` - Type of the value.
Parameters:
  `key` - Metadata key.
  `val` - Metadata value.
Returns:
  Metadata previously associated with given name, or `null` if there was none.

#### putMetaIfAbsent

    @Nullable
    <V> V putMetaIfAbsent(int key,
                                 V val)

Adds given metadata value only if it was absent.

Type Parameters:
  `V` - Type of the value.
Parameters:
  `key` - Metadata key.
  `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

    <V> boolean replaceMeta(int key,
                          V curVal,
                          V newVal)

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

Parameters:
  `key` - Key of the metadata.
  `curVal` - Current value to check.
  `newVal` - New value.
Returns:
  `true` if replacement occurred, `false` otherwise.

#### removeMeta

    @Nullable
    <V> V removeMeta(int key)

Removes metadata by key.

Type Parameters:
  `V` - Type of the value.
Parameters:
  `key` - Key of the metadata to remove.
Returns:
  Value of removed metadata or `null`.

#### removeMeta

    <V> boolean removeMeta(int key,
                         V val)

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

Type Parameters:
  `V` - Value type.
Parameters:
  `key` - key of metadata attribute.
  `val` - Value to compare.
Returns:
  `True` if value was removed, `false` otherwise.

#### onUnlock

    void onUnlock()

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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016