org.apache.ignite.internal.processors.cache.distributed.dht.colocated

## Class GridDhtDetachedCacheEntry

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter
  - - org.apache.ignite.internal.processors.cache.GridCacheMapEntry
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheEntry
      - - org.apache.ignite.internal.processors.cache.distributed.dht.colocated.GridDhtDetachedCacheEntry

All Implemented Interfaces:
  GridCacheEntryEx

    public class GridDhtDetachedCacheEntry
    extends GridDistributedCacheEntry

Detached cache entry.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter

`GridMetadataAwareAdapter.EntryKey`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheMapEntry

`ATOMIC_VER_COMPARATOR, cctx, flags, key, log, logRef, val, ver`

### Constructor Summary

Constructors
Constructor and Description
`GridDhtDetachedCacheEntry(GridCacheContext ctx, KeyCacheObject key)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `addRemoved(GridCacheVersion ver)`
`boolean` `detached()`
`protected WALPointer` `logTxUpdate(IgniteInternalTx tx, CacheObject val, long expireTime, long updCntr)`
`protected void` `logUpdate(GridCacheOperation op, CacheObject val, GridCacheVersion writeVer, long expireTime, long updCntr)`
`int` `partition()`
`protected void` `removeValue()` Removes value from offheap.
`void` `resetFromPrimary(CacheObject val, GridCacheVersion ver)` Sets value to detached entry so it can be retrieved in transactional gets.
`protected boolean` `storeValue(CacheObject val, long expireTime, GridCacheVersion ver)` Stores value in offheap.
`String` `toString()`
`@Nullable CacheDataRow` `unswap(CacheDataRow row, boolean checkExpire)` Unswaps an entry.
`protected void` `value(@Nullable CacheObject val)` Sets entry value.

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheEntry

`addLocal, addRemote, checkCallbacks, checkRemoved, checkThreadChain, doneRemote, readyLock, readyNearLock, recheck, remoteMvccSnapshot, removeExplicitNodeLocks, removeLock, removeLock, tmLock`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheMapEntry

`allVersionsInfo, candidate, candidate, checkObsolete, checkOwnerChanged, checkOwnerChanged, checkSerializableReadVersion, clear, clearReader, clearReaders, clearReserveForLoad, context, decrementMapPublicSize, deleted, deletedUnlocked, deletedUnlocked, equals, evictInternal, evictionDisabled, expireTime, expireTimeExtras, expireTimeUnlocked, hashCode, hasLockCandidate, hasLockCandidate, hasLockCandidateUnsafe, hasReaders, hasValue, hasValueUnlocked, incrementMapPublicSize, info, initialValue, innerGet, innerGetAndReserveForLoad, innerGetVersioned, innerReload, innerRemove, innerSet, innerUpdate, innerUpdateLocal, invalidate, isDht, isInternal, isLocal, isMvcc, isNear, isNew, isNewLocked, isReplicated, isStartVersion, key, keyValue, localCandidate, localCandidates, localOwner, localPartition, lockedBy, lockedByAny, lockedByCurrentThread, lockedByThread, lockedByThread, lockedByThread, lockedByThreadUnsafe, lockedByUnsafe, lockedLocally, lockedLocallyByIdOrThread, lockedLocallyUnsafe, lockEntry, logMvccUpdate, markObsolete, markObsolete0, markObsoleteIfEmpty, markObsoleteVersion, memorySize, mvccAllLocal, mvccExtras, mvccExtras, mvccLock, mvccPeek, mvccPreloadEntry, mvccRemove, mvccSet, mvccUpdateRowsWithPreloadInfo, nextPartitionCounter, nextPartitionCounter, obsolete, obsolete, obsoleteOrDeleted, obsoleteVersion, obsoleteVersionExtras, onInvalidate, onMarkedObsolete, onTtlExpired, onUnlock, onUpdateFinished, partitionValid, peek, peek, peekVisibleValue, rawExpireTime, rawGet, rawPut, rawTtl, readThrough, recordNodeId, storeValue, touch, ttl, ttlAndExpireTimeExtras, ttlExtras, txKey, txUnlock, unlockEntry, unswap, unswap, unswap, update, updateIndex, updateTtl, valid, valueBytes, valueBytes, valueBytes0, version, versionedEntry, versionedValue, visitable, wrap, wrapEviction, wrapLazyValue, wrapVersioned`

### Methods inherited from class org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter

`addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, readExternalMeta, removeAllMeta, removeMeta, removeMeta, replaceMeta, writeExternalMeta`

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

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

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

`addMeta, hasMeta, initialValue, initialValue, meta, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta`

### Constructor Detail

#### GridDhtDetachedCacheEntry

    public GridDhtDetachedCacheEntry(GridCacheContext ctx,
                                     KeyCacheObject key)

Parameters:
  `ctx` - Cache context.
  `key` - Cache key.

### Method Detail

#### resetFromPrimary

    public void resetFromPrimary(CacheObject val,
                                 GridCacheVersion ver)

Sets value to detached entry so it can be retrieved in transactional gets.

Parameters:
  `val` - Value.
  `ver` - Version.

#### unswap

    @Nullable
    public @Nullable CacheDataRow unswap(CacheDataRow row,
                                                   boolean checkExpire)
                                            throws IgniteCheckedException

Unswaps an entry.

Overrides:
  `unswap` in class `GridCacheMapEntry`
Parameters:
  `row` - Already extracted cache data.
  `checkExpire` - If `true` checks for expiration, as result entry can be obsoleted or marked deleted.
Returns:
  Value.
Throws:
  `IgniteCheckedException` - If failed.

#### value

    protected void value(@Nullable
                         @Nullable CacheObject val)

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

Overrides:
  `value` in class `GridCacheMapEntry`
Parameters:
  `val` - Value to store.

#### storeValue

    protected boolean storeValue(CacheObject val,
                                 long expireTime,
                                 GridCacheVersion ver)
                          throws IgniteCheckedException

Stores value in offheap.

Overrides:
  `storeValue` in class `GridCacheMapEntry`
Parameters:
  `val` - Value.
  `expireTime` - Expire time.
  `ver` - New entry version.
Throws:
  `IgniteCheckedException` - If update failed.

#### logUpdate

    protected void logUpdate(GridCacheOperation op,
                             CacheObject val,
                             GridCacheVersion writeVer,
                             long expireTime,
                             long updCntr)
                      throws IgniteCheckedException

Overrides:
  `logUpdate` in class `GridCacheMapEntry`
Parameters:
  `op` - Update operation.
  `val` - Write value.
  `writeVer` - Write version.
  `expireTime` - Expire time.
  `updCntr` - Update counter.
Throws:
  `IgniteCheckedException`

#### logTxUpdate

    protected WALPointer logTxUpdate(IgniteInternalTx tx,
                                     CacheObject val,
                                     long expireTime,
                                     long updCntr)
                              throws IgniteCheckedException

Overrides:
  `logTxUpdate` in class `GridCacheMapEntry`
Parameters:
  `tx` - Transaction.
  `val` - Value.
  `expireTime` - Expire time (or 0 if not applicable).
  `updCntr` - Update counter.
Throws:
  `IgniteCheckedException` - In case of log failure.

#### removeValue

    protected void removeValue()
                        throws IgniteCheckedException

Removes value from offheap.

Overrides:
  `removeValue` in class `GridCacheMapEntry`
Throws:
  `IgniteCheckedException` - If failed.

#### detached

    public boolean detached()

Specified by:
  `detached` in interface `GridCacheEntryEx`
Overrides:
  `detached` in class `GridCacheMapEntry`
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.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedCacheEntry`

#### addRemoved

    public boolean addRemoved(GridCacheVersion ver)

Overrides:
  `addRemoved` in class `GridDistributedCacheEntry`
Parameters:
  `ver` - Lock version.
Returns:
  `True` if removed.

#### partition

    public int partition()

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

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.1
Release Date | : May 21 2020