public class GridNearCacheEntry<K,V> extends GridDistributedCacheEntry<K,V>
| Constructor and Description |
|---|
GridNearCacheEntry(GridCacheContext<K,V> ctx,
K key,
int hash,
V val,
GridCacheMapEntry<K,V> next,
long ttl,
int hdrId) |
| Modifier and Type | Method and Description |
|---|---|
GridCacheMvccCandidate<K> |
addLocal(long threadId,
GridCacheVersion ver,
long timeout,
boolean reenter,
boolean tx,
boolean implicitSingle)
Add local candidate.
|
GridCacheMvccCandidate<K> |
addNearLocal(UUID dhtNodeId,
long threadId,
GridCacheVersion ver,
long timeout,
boolean reenter,
boolean tx,
boolean implicitSingle)
Add near local candidate.
|
protected void |
clearIndex(V val)
Clears index.
|
GridCacheMvccCandidate<K> |
dhtNodeId(GridCacheVersion ver,
UUID dhtNodeId) |
GridCacheVersion |
dhtVersion() |
boolean |
initializeFromDht(long topVer) |
boolean |
isNear() |
boolean |
loadedValue(GridCacheTxEx tx,
UUID primaryNodeId,
V val,
byte[] valBytes,
GridCacheVersion ver,
GridCacheVersion dhtVer,
GridCacheVersion expVer,
long ttl,
long expireTime,
boolean evt,
long topVer,
UUID subjId) |
int |
memorySize() |
protected void |
onInvalidate()
Called when entry invalidated.
|
int |
partition() |
protected V |
readThrough(GridCacheTxEx<K,V> tx,
K key,
boolean reload,
GridPredicate<GridCacheEntry<K,V>>[] filter,
UUID subjId) |
GridCacheMvccCandidate<K> |
readyLock(GridCacheMvccCandidate<K> cand) |
void |
recordDhtVersion(GridCacheVersion dhtVer)
This method should be called only when committing optimistic transactions.
|
protected void |
recordNodeId(UUID primaryNodeId) |
protected void |
refreshAhead(K key,
GridCacheVersion matchVer) |
GridCacheMvccCandidate<K> |
removeLock()
Unlocks local lock.
|
boolean |
resetFromPrimary(V val,
byte[] valBytes,
GridCacheVersion ver,
GridCacheVersion dhtVer,
UUID primaryNodeId)
This method should be called only when lock is owned on this entry.
|
String |
toString() |
protected void |
updateIndex(V val,
byte[] valBytes,
long expireTime,
GridCacheVersion ver,
V old)
Updates cache index.
|
void |
updateOrEvict(GridCacheVersion dhtVer,
V val,
byte[] valBytes,
long expireTime,
long ttl,
UUID primaryNodeId)
This method should be called only when lock is owned on this entry.
|
boolean |
valid(long topVer) |
GridTuple3<GridCacheVersion,V,byte[]> |
versionedValue() |
GridCacheEntry<K,V> |
wrap(boolean prjAware)
Wraps this map entry into cache entry.
|
addRemote, addRemote, addRemoteCandidates, addRemoved, checkCallbacks, checkOwnerChanged, checkRemoved, checkThreadChain, doneRemote, doneRemote, orderCompleted, readyLock, readyNearLock, recheck, refreshRemotes, remoteMvccSnapshot, removeExplicitNodeLocks, removeLock, tmLock, txUnlockaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, candidate, candidate, checkObsolete, clear, clearReaders, compact, context, copyMeta, copyMeta, createValueBytes, deleted, deletedUnlocked, deletedUnlocked, detached, drEntry, equals, evictInBatchInternal, evictInternal, evictWrap, expireTime, expireTimeExtras, expireTimeUnlocked, getOrMarshalKeyBytes, hashCode, hasLockCandidate, hasLockCandidate, hasLockCandidateUnsafe, hasMeta, hasMeta, hasReaders, hasValue, hasValueUnlocked, info, initialValue, initialValue, innerGet, innerReload, innerRemove, innerSet, innerUpdate, innerUpdateLocal, invalidate, invalidate, isDht, isInternal, isLocal, 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, meta, mvccExtras, mvccExtras, obsolete, obsolete, obsoleteOrDeleted, obsoleteVersion, obsoleteVersionExtras, obsoleteVersionExtras, onMarkedObsolete, onTtlExpired, partitionValid, peek, peek, peek0, peekFailFast, poke, putMetaIfAbsent, putMetaIfAbsent, rawExpireTime, rawGet, rawGetOrUnmarshal, rawGetOrUnmarshalUnlocked, rawPut, rawTtl, readExternalMeta, refreshingLocked, refreshingUnlocked, releaseSwap, removeMeta, removeMeta, replaceMeta, saveValueForIndexUnlocked, startVersion, toExpireTime, ttl, ttlAndExpireTimeExtras, ttlExtras, unswap, unswap, update, value, valueBytes, valueBytes, valueBytesUnlocked, version, versionedValue, visitable, wrapFilterLocked, writeExternalMetapublic GridNearCacheEntry(GridCacheContext<K,V> ctx, K key, int hash, V val, GridCacheMapEntry<K,V> next, long ttl, int hdrId)
ctx - Cache context.key - Cache key.hash - Key hash value.val - Entry value.next - Next entry in the linked list.ttl - Time to live.hdrId - Header id.public int memorySize()
throws GridException
memorySize in interface GridCacheEntryEx<K,V>memorySize in class GridCacheMapEntry<K,V>GridException - If failed.public int partition()
partition in interface GridCacheEntryEx<K,V>partition in class GridCacheMapEntry<K,V>public boolean isNear()
isNear in interface GridCacheEntryEx<K,V>isNear in class GridCacheMapEntry<K,V>True if near.public boolean valid(long topVer)
valid in interface GridCacheEntryEx<K,V>valid in class GridCacheMapEntry<K,V>topVer - Topology version where validation should be performed.
When negative the latest available topology should be used.public boolean initializeFromDht(long topVer)
throws GridCacheEntryRemovedException
topVer - Topology version.True if this entry was initialized by this call.GridCacheEntryRemovedException - If this entry is obsolete.public boolean resetFromPrimary(V val, byte[] valBytes, GridCacheVersion ver, GridCacheVersion dhtVer, UUID primaryNodeId) throws GridCacheEntryRemovedException, GridException
val - Value.valBytes - Value bytes.ver - Version.dhtVer - DHT version.primaryNodeId - Primary node ID.True if reset was done.GridCacheEntryRemovedException - If obsolete.GridException - If failed.public void updateOrEvict(GridCacheVersion dhtVer, @Nullable V val, @Nullable byte[] valBytes, long expireTime, long ttl, UUID primaryNodeId)
dhtVer - DHT version.val - Value associated with version.valBytes - Value bytes.expireTime - Expire time.ttl - Time to live.primaryNodeId - Primary node ID.@Nullable public GridCacheVersion dhtVersion() throws GridCacheEntryRemovedException
GridCacheEntryRemovedException - If obsolete.@Nullable public GridTuple3<GridCacheVersion,V,byte[]> versionedValue() throws GridCacheEntryRemovedException
GridCacheEntryRemovedException - If entry has been removed.protected void recordNodeId(UUID primaryNodeId)
recordNodeId in class GridCacheMapEntry<K,V>primaryNodeId - Node ID.public void recordDhtVersion(GridCacheVersion dhtVer)
dhtVer - DHT version to record.protected void refreshAhead(K key, GridCacheVersion matchVer)
refreshAhead in class GridCacheMapEntry<K,V>key - Key.matchVer - Version to match.protected V readThrough(GridCacheTxEx<K,V> tx, K key, boolean reload, GridPredicate<GridCacheEntry<K,V>>[] filter, UUID subjId) throws GridException
readThrough in class GridCacheMapEntry<K,V>tx - Transaction.key - Key.reload - flag.filter - Filter.GridException - If failed.public boolean loadedValue(@Nullable GridCacheTxEx tx, UUID primaryNodeId, V val, byte[] valBytes, GridCacheVersion ver, GridCacheVersion dhtVer, @Nullable GridCacheVersion expVer, long ttl, long expireTime, boolean evt, long topVer, UUID subjId) throws GridException, GridCacheEntryRemovedException
tx - Transaction.primaryNodeId - Primary node ID.val - New value.valBytes - Value bytes.ver - Version to use.dhtVer - DHT version received from remote node.expVer - Optional version to match.ttl - Time to live.expireTime - Expiration time.evt - Event flag.topVer - Topology version.True if initial value was set.GridException - In case of error.GridCacheEntryRemovedException - If entry was removed.protected void updateIndex(V val, byte[] valBytes, long expireTime, GridCacheVersion ver, V old) throws GridException
updateIndex in class GridCacheMapEntry<K,V>val - Value.valBytes - Value bytes.expireTime - Expire time.ver - New entry version.old - Previous value.GridException - If update failed.protected void clearIndex(V val)
clearIndex in class GridCacheMapEntry<K,V>val - Previous value (if needed for index update).public GridCacheMvccCandidate<K> addLocal(long threadId, GridCacheVersion ver, long timeout, boolean reenter, boolean tx, boolean implicitSingle) throws GridCacheEntryRemovedException
addLocal in class GridDistributedCacheEntry<K,V>threadId - Owning thread ID.ver - Lock version.timeout - Timeout to acquire lock.reenter - Reentry flag.tx - Transaction flag.implicitSingle - Implicit flag.GridCacheEntryRemovedException - If entry has been removed.@Nullable public GridCacheMvccCandidate<K> addNearLocal(@Nullable UUID dhtNodeId, long threadId, GridCacheVersion ver, long timeout, boolean reenter, boolean tx, boolean implicitSingle) throws GridCacheEntryRemovedException
dhtNodeId - DHT node ID.threadId - Owning thread ID.ver - Lock version.timeout - Timeout to acquire lock.reenter - Reentry flag.tx - Transaction flag.implicitSingle - Implicit flag.GridCacheEntryRemovedException - If entry has been removed.@Nullable public GridCacheMvccCandidate<K> dhtNodeId(GridCacheVersion ver, UUID dhtNodeId) throws GridCacheEntryRemovedException
ver - Version to set DHT node ID for.dhtNodeId - DHT node ID.true if candidate was found.GridCacheEntryRemovedException - If entry is removed.public GridCacheMvccCandidate<K> readyLock(GridCacheMvccCandidate<K> cand) throws GridCacheEntryRemovedException
readyLock in class GridDistributedCacheEntry<K,V>cand - Candidate to acquire lock for.GridCacheEntryRemovedException - If entry is removed.@Nullable public GridCacheMvccCandidate<K> removeLock()
removeLock in class GridDistributedCacheEntry<K,V>protected void onInvalidate()
onInvalidate in class GridCacheMapEntry<K,V>public GridCacheEntry<K,V> wrap(boolean prjAware)
wrap in interface GridCacheEntryEx<K,V>wrap in class GridCacheMapEntry<K,V>prjAware - true if entry should inherit projection properties.public String toString()
toString in class GridDistributedCacheEntry<K,V>Copyright © 2014. All rights reserved.