org.apache.ignite.internal.processors.cache.local

## Class GridLocalCacheEntry

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter
  - - org.apache.ignite.internal.processors.cache.GridCacheMapEntry
    - - org.apache.ignite.internal.processors.cache.local.GridLocalCacheEntry

All Implemented Interfaces:
  GridCacheEntryEx

    public class GridLocalCacheEntry
    extends GridCacheMapEntry

Cache entry for local caches.

### 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, startVer, val, ver`

### Constructor Summary

Constructors
Constructor and Description
`GridLocalCacheEntry(GridCacheContext ctx, KeyCacheObject key, int hash, CacheObject val, GridCacheMapEntry next, int hdrId)`

### Method Summary

Methods
`GridCacheMvccCandidate` `addLocal(long threadId, GridCacheVersion ver, GridCacheVersion serOrder, GridCacheVersion serReadVer, long timeout, boolean reenter, boolean tx, boolean implicitSingle, boolean keepBinary)` Add local candidate.
`protected boolean` `hasOffHeapPointer()`
`boolean` `isLocal()`
`protected long` `offHeapPointer()`
`protected void` `offHeapPointer(long valPtr)`
`GridCacheMvccCandidate` `readyLocal(GridCacheMvccCandidate cand)`
`GridCacheMvccCandidate` `readyLocal(GridCacheVersion ver)`
`GridCacheMvccCandidate` `recheck()` Rechecks if lock should be reassigned.
`boolean` `removeLock(GridCacheVersion ver)`
`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.
`String` `toString()`
`void` `txUnlock(IgniteInternalTx tx)` Unlocks lock if it is currently owned.

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

`candidate, candidate, checkObsolete, checkSerializableReadVersion, clear, clearIndex, clearReader, clearReaders, context, deleted, deletedUnlocked, deletedUnlocked, detached, equals, evictInBatchInternal, evictInternal, evictionDisabled, expireTime, expireTimeExtras, expireTimeUnlocked, hashCode, hasLockCandidate, hasLockCandidate, hasLockCandidateUnsafe, hasReaders, hasValue, hasValueUnlocked, info, initialValue, initialValue, innerGet, innerGetVersioned, innerReload, innerRemove, innerSet, innerUpdate, innerUpdateLocal, invalidate, invalidate, isDht, isInternal, isNear, isNew, isNewLocked, isOffHeapValuesOnly, isReplicated, isStartVersion, key, keyValue, localCandidate, localCandidates, localOwner, lockedBy, lockedByAny, lockedByThread, lockedByThread, lockedByThread, lockedByThreadUnsafe, lockedByUnsafe, lockedLocally, lockedLocallyByIdOrThread, lockedLocallyUnsafe, markObsolete, markObsolete0, markObsoleteIfEmpty, markObsoleteVersion, memorySize, mvccExtras, mvccExtras, obsolete, obsolete, obsoleteOrDeleted, obsoleteVersion, obsoleteVersionExtras, obsoleteVersionExtras, offheapSwapEvict, onInvalidate, onMarkedObsolete, onTtlExpired, onUnlock, partition, partitionValid, peek, peek, peekVisibleValue, rawExpireTime, rawGet, rawGetOrUnmarshal, rawGetOrUnmarshalUnlocked, rawPut, rawTtl, readThrough, recordNodeId, releaseSwap, remoteMvccSnapshot, saveValueForIndexUnlocked, startVersion, ttl, ttlAndExpireTimeExtras, ttlExtras, txKey, unswap, unswap, update, updateIndex, updateTtl, valid, value, valueBytes, valueBytes, valueBytes0, valueBytesUnlocked, 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, meta, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta`

### Constructor Detail

#### GridLocalCacheEntry

    public GridLocalCacheEntry(GridCacheContext ctx,
                       KeyCacheObject key,
                       int hash,
                       CacheObject val,
                       GridCacheMapEntry next,
                       int hdrId)

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

### Method Detail

#### isLocal

    public boolean isLocal()

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

#### addLocal

    @Nullable
    public GridCacheMvccCandidate addLocal(long threadId,
                                           GridCacheVersion ver,
                                           @Nullable
                                           GridCacheVersion serOrder,
                                           @Nullable
                                           GridCacheVersion serReadVer,
                                           long timeout,
                                           boolean reenter,
                                           boolean tx,
                                           boolean implicitSingle,
                                           boolean keepBinary)
                                    throws GridCacheEntryRemovedException

Add local candidate.

Parameters:
  `threadId` - Owning thread ID.
  `ver` - Lock version.
  `serOrder` - Version for serializable transactions ordering.
  `serReadVer` - Optional read entry version for optimistic serializable transaction.
  `timeout` - Timeout to acquire lock.
  `reenter` - Reentry flag.
  `tx` - Transaction flag.
  `implicitSingle` - Implicit transaction flag.
Returns:
  New candidate.
Throws:
  `GridCacheEntryRemovedException` - If entry has been removed.

#### readyLocal

    @Nullable
    public GridCacheMvccCandidate readyLocal(GridCacheMvccCandidate cand)

Parameters:
  `cand` - Candidate.
Returns:
  Current owner.

#### readyLocal

    @Nullable
    public GridCacheMvccCandidate readyLocal(GridCacheVersion ver)

Parameters:
  `ver` - Candidate version.
Returns:
  Current owner.

#### tmLock

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

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.

#### recheck

    @Nullable
    public GridCacheMvccCandidate recheck()

Rechecks if lock should be reassigned.

Returns:
  Current owner.

#### txUnlock

    public void txUnlock(IgniteInternalTx tx)
                  throws GridCacheEntryRemovedException

Unlocks lock if it is currently owned.

Parameters:
  `tx` - Transaction to unlock.
Throws:
  `GridCacheEntryRemovedException` - If this entry has been removed from cache.

#### removeLock

    public 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.

#### hasOffHeapPointer

    protected boolean hasOffHeapPointer()

Overrides:
  `hasOffHeapPointer` in class `GridCacheMapEntry`
Returns:
  True if entry has off-heap value pointer.

#### offHeapPointer

    protected long offHeapPointer()

Overrides:
  `offHeapPointer` in class `GridCacheMapEntry`
Returns:
  Off-heap value pointer.

#### offHeapPointer

    protected void offHeapPointer(long valPtr)

Overrides:
  `offHeapPointer` in class `GridCacheMapEntry`
Parameters:
  `valPtr` - Off-heap value pointer.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheMapEntry`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015