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

## Class GridLocalCacheEntry<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMapEntry<K,V>
  - - org.apache.ignite.internal.processors.cache.local.GridLocalCacheEntry<K,V>

All Implemented Interfaces:
  GridCacheEntryEx<K,V>

    public class GridLocalCacheEntry<K,V>
    extends GridCacheMapEntry<K,V>

Cache entry for local caches.

### Field Summary

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

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

### Constructor Summary

Constructors
Constructor and Description
`GridLocalCacheEntry(GridCacheContext<K,V> ctx, K key, int hash, V val, GridCacheMapEntry<K,V> next, long ttl, int hdrId)`

### Method Summary

Methods
`GridCacheMvccCandidate<K>` `addLocal(long threadId, GridCacheVersion ver, long timeout, boolean reenter, boolean tx, boolean implicitSingle)` Add local candidate.
`boolean` `isLocal()`
`GridCacheMvccCandidate<K>` `readyLocal(GridCacheMvccCandidate<K> cand)`
`GridCacheMvccCandidate<K>` `readyLocal(GridCacheVersion ver)`
`GridCacheMvccCandidate<K>` `recheck()` Rechecks if lock should be reassigned.
`boolean` `removeLock(GridCacheVersion ver)`
`boolean` `tmLock(IgniteInternalTx<K,V> tx, long timeout)` This locks is called by transaction manager during prepare step for optimistic transactions.
`void` `txUnlock(IgniteInternalTx<K,V> tx)` Unlocks lock if it is currently owned.

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

`addMeta, candidate, candidate, checkObsolete, clear, clearIndex, clearReader, clearReaders, compact, context, deleted, deletedUnlocked, deletedUnlocked, detached, equals, evictInBatchInternal, evictInternal, expireTime, expireTimeExtras, expireTimeUnlocked, getOrMarshalKeyBytes, hashCode, hasLockCandidate, hasLockCandidate, hasLockCandidateUnsafe, hasMeta, hasReaders, hasValue, hasValueUnlocked, info, initialValue, initialValue, innerGet, innerReload, innerRemove, innerSet, innerUpdate, innerUpdateLocal, invalidate, invalidate, isDht, isInternal, isNear, isNew, isNewLocked, isOffHeapValuesOnly, isReplicated, isStartVersion, isStoreValueBytes, key, keyBytes, keyBytes, localCandidate, localCandidates, localOwner, lockedBy, lockedByAny, lockedByThread, lockedByThread, lockedByThread, lockedByThreadUnsafe, lockedByUnsafe, lockedLocally, lockedLocallyByIdOrThread, lockedLocallyUnsafe, markObsolete, markObsolete0, markObsoleteIfEmpty, markObsoleteVersion, memorySize, meta, mvccExtras, mvccExtras, obsolete, obsolete, obsoleteOrDeleted, obsoleteVersion, obsoleteVersionExtras, obsoleteVersionExtras, onInvalidate, onMarkedObsolete, onTtlExpired, partition, partitionValid, peek, peek, peek, peek0, peekFailFast, poke, putMetaIfAbsent, putMetaIfAbsent, rawExpireTime, rawGet, rawGetOrUnmarshal, rawGetOrUnmarshalUnlocked, rawPut, rawTtl, readExternalMeta, readThrough, recordNodeId, releaseSwap, remoteMvccSnapshot, removeMeta, removeMeta, replaceMeta, saveValueForIndexUnlocked, startVersion, toExpireTime, toString, ttl, ttlAndExpireTimeExtras, ttlExtras, txKey, unswap, unswap, update, updateIndex, updateTtl, valid, value, valueBytes, valueBytes, valueBytesUnlocked, version, versionedEntry, versionedValue, visitable, wrap, wrapEviction, wrapFilterLocked, wrapLazyValue, wrapVersioned, writeExternalMeta`

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

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

### Constructor Detail

#### GridLocalCacheEntry

    public GridLocalCacheEntry(GridCacheContext<K,V> ctx,
                       K key,
                       int hash,
                       V val,
                       GridCacheMapEntry<K,V> next,
                       long ttl,
                       int hdrId)

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

### Method Detail

#### isLocal

    public boolean isLocal()

Specified by:
  `isLocal` in interface `GridCacheEntryEx<K,V>`
Overrides:
  `isLocal` in class `GridCacheMapEntry<K,V>`
Returns:
  `True` if local.

#### addLocal

    @Nullable
    public GridCacheMvccCandidate<K> addLocal(long threadId,
                                              GridCacheVersion ver,
                                              long timeout,
                                              boolean reenter,
                                              boolean tx,
                                              boolean implicitSingle)
                                       throws GridCacheEntryRemovedException

Add local candidate.

Parameters:
  `threadId` - Owning thread ID.
  `ver` - Lock version.
  `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<K> readyLocal(GridCacheMvccCandidate<K> cand)

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

#### readyLocal

    @Nullable
    public GridCacheMvccCandidate<K> readyLocal(GridCacheVersion ver)

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

#### tmLock

    public boolean tmLock(IgniteInternalTx<K,V> tx,
                 long timeout)
                   throws GridCacheEntryRemovedException

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

Parameters:
  `tx` - Cache transaction.
  `timeout` - Timeout for lock acquisition.
Returns:
  `True` if lock was acquired, `false` otherwise.
Throws:
  `GridCacheEntryRemovedException` - If this entry is obsolete.

#### recheck

    @Nullable
    public GridCacheMvccCandidate<K> recheck()

Rechecks if lock should be reassigned.

Returns:
  Current owner.

#### txUnlock

    public void txUnlock(IgniteInternalTx<K,V> 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.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015