public class GridDistributedCacheEntry extends GridCacheMapEntry
GridMetadataAwareAdapter.EntryKey
ATOMIC_VER_COMPARATOR, cctx, flags, key, log, logRef, startVer, val, ver
Constructor and Description |
---|
GridDistributedCacheEntry(GridCacheContext ctx,
KeyCacheObject key,
int hash,
CacheObject val) |
Modifier and Type | Method and Description |
---|---|
GridCacheMvccCandidate |
addLocal(long threadId,
GridCacheVersion ver,
AffinityTopologyVersion topVer,
long timeout,
boolean reenter,
boolean tx,
boolean implicitSingle,
boolean read)
Add local candidate.
|
void |
addRemote(UUID nodeId,
UUID otherNodeId,
long threadId,
GridCacheVersion ver,
boolean tx,
boolean implicitSingle,
GridCacheVersion owned)
Adds new lock candidate.
|
boolean |
addRemoved(GridCacheVersion ver) |
protected void |
checkCallbacks(boolean emptyBefore,
boolean emptyAfter) |
protected void |
checkRemoved(GridCacheVersion ver) |
protected void |
checkThreadChain(GridCacheMvccCandidate owner) |
void |
doneRemote(GridCacheVersion lockVer,
GridCacheVersion baseVer,
Collection<GridCacheVersion> pendingVers,
Collection<GridCacheVersion> committedVers,
Collection<GridCacheVersion> rolledbackVers,
boolean sysInvalidate) |
CacheLockCandidates |
readyLock(GridCacheVersion ver) |
void |
readyNearLock(GridCacheVersion ver,
GridCacheVersion mapped,
Collection<GridCacheVersion> committed,
Collection<GridCacheVersion> rolledBack,
Collection<GridCacheVersion> pending)
Notifies mvcc that near local lock is ready to be acquired.
|
void |
recheck()
Rechecks if lock should be reassigned.
|
Collection<GridCacheMvccCandidate> |
remoteMvccSnapshot(GridCacheVersion... exclude)
Gets all remote versions.
|
void |
removeExplicitNodeLocks(UUID nodeId)
Removes all lock candidates for node.
|
GridCacheMvccCandidate |
removeLock()
Unlocks local lock.
|
boolean |
removeLock(GridCacheVersion ver) |
boolean |
tmLock(IgniteInternalTx tx,
long timeout,
GridCacheVersion serOrder,
GridCacheVersion serReadVer,
boolean read)
This locks is called by transaction manager during prepare step
for optimistic transactions.
|
String |
toString() |
void |
txUnlock(IgniteInternalTx tx)
Unlocks acquired lock.
|
candidate, candidate, checkObsolete, checkOwnerChanged, checkSerializableReadVersion, clear, clearIndex, clearReader, clearReaders, clearReserveForLoad, context, decrementMapPublicSize, deleted, deletedUnlocked, deletedUnlocked, detached, equals, evictInBatchInternal, evictInternal, evictionDisabled, expireTime, expireTimeExtras, expireTimeUnlocked, hashCode, hasLockCandidate, hasLockCandidate, hasLockCandidateUnsafe, hasOffHeapPointer, hasReaders, hasValue, hasValueUnlocked, incrementMapPublicSize, info, initialValue, initialValue, innerGet, innerGetAndReserveForLoad, innerGetVersioned, innerReload, innerRemove, innerSet, innerUpdate, innerUpdateLocal, invalidate, invalidate, isDht, isInternal, isLocal, 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, mvccAllLocal, mvccExtras, mvccExtras, obsolete, obsolete, obsoleteOrDeleted, obsoleteVersion, obsoleteVersionExtras, offHeapPointer, offHeapPointer, onInvalidate, onMarkedObsolete, onOffheapEvict, onTtlExpired, onUnlock, partition, partitionValid, peek, peek, peekVisibleValue, rawExpireTime, rawGet, rawGetOrUnmarshal, rawGetOrUnmarshalUnlocked, rawPut, rawTtl, readThrough, recordNodeId, releaseSwap, saveValueForIndexUnlocked, startVersion, ttl, ttlAndExpireTimeExtras, ttlExtras, txKey, unswap, unswap, unswap, update, updateIndex, updateTtl, updateTtl, valid, value, valueBytes, valueBytes, valueBytes0, valueBytesUnlocked, version, versionedEntry, versionedValue, visitable, wrap, wrapEviction, wrapLazyValue, wrapVersioned
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, readExternalMeta, removeAllMeta, removeMeta, removeMeta, replaceMeta, writeExternalMeta
finalize, getClass, notify, notifyAll, wait, wait, wait
addMeta, hasMeta, meta, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta
public GridDistributedCacheEntry(GridCacheContext ctx, KeyCacheObject key, int hash, CacheObject val)
ctx
- Cache context.key
- Cache key.hash
- Key hash value.val
- Entry value.@Nullable public GridCacheMvccCandidate addLocal(long threadId, GridCacheVersion ver, AffinityTopologyVersion topVer, long timeout, boolean reenter, boolean tx, boolean implicitSingle, boolean read) throws GridCacheEntryRemovedException
threadId
- Owning thread ID.ver
- Lock version.topVer
- Topology version.timeout
- Timeout to acquire lock.reenter
- Reentry flag.tx
- Transaction flag.implicitSingle
- Implicit flag.read
- Read lock flag.GridCacheEntryRemovedException
- If entry has been removed.public Collection<GridCacheMvccCandidate> remoteMvccSnapshot(GridCacheVersion... exclude)
remoteMvccSnapshot
in interface GridCacheEntryEx
remoteMvccSnapshot
in class GridCacheMapEntry
exclude
- Exclude version.public void addRemote(UUID nodeId, @Nullable UUID otherNodeId, long threadId, GridCacheVersion ver, boolean tx, boolean implicitSingle, @Nullable GridCacheVersion owned) throws GridDistributedLockCancelledException, GridCacheEntryRemovedException
nodeId
- Node ID.otherNodeId
- Other node ID.threadId
- Thread ID.ver
- Lock version.tx
- Transaction flag.implicitSingle
- Implicit flag.owned
- Owned candidate version.GridDistributedLockCancelledException
- If lock has been canceled.GridCacheEntryRemovedException
- If this entry is obsolete.public void removeExplicitNodeLocks(UUID nodeId) throws GridCacheEntryRemovedException
nodeId
- ID of node to remove locks from.GridCacheEntryRemovedException
- If entry was removed.@Nullable public GridCacheMvccCandidate removeLock()
public boolean removeLock(GridCacheVersion ver) throws GridCacheEntryRemovedException
ver
- Removes lock.True
If lock has been removed.GridCacheEntryRemovedException
- If this entry has been removed from cache.protected void checkRemoved(GridCacheVersion ver) throws GridDistributedLockCancelledException
ver
- Lock version.GridDistributedLockCancelledException
- If lock is cancelled.public boolean addRemoved(GridCacheVersion ver)
ver
- Lock version.True
if removed.@Nullable public CacheLockCandidates readyLock(GridCacheVersion ver) throws GridCacheEntryRemovedException
ver
- Version of candidate to acquire lock for.GridCacheEntryRemovedException
- If entry is removed.public void readyNearLock(GridCacheVersion ver, GridCacheVersion mapped, Collection<GridCacheVersion> committed, Collection<GridCacheVersion> rolledBack, Collection<GridCacheVersion> pending) throws GridCacheEntryRemovedException
ver
- Lock version.mapped
- Mapped dht lock version.committed
- Committed versions.rolledBack
- Rolled back versions.pending
- Pending locks on dht node with version less then mapped.GridCacheEntryRemovedException
- If entry is removed.public void doneRemote(GridCacheVersion lockVer, GridCacheVersion baseVer, @Nullable Collection<GridCacheVersion> pendingVers, Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers, boolean sysInvalidate) throws GridCacheEntryRemovedException
lockVer
- Done version.baseVer
- Base version.pendingVers
- Pending versions that are less than lock version.committedVers
- Completed versions for reordering.rolledbackVers
- Rolled back versions for reordering.sysInvalidate
- Flag indicating if this entry is done from invalidated transaction (in case of tx
salvage). In this case all locks before salvaged lock will marked as used and corresponding
transactions will be invalidated.GridCacheEntryRemovedException
- If entry has been removed.public void recheck()
public boolean tmLock(IgniteInternalTx tx, long timeout, @Nullable GridCacheVersion serOrder, GridCacheVersion serReadVer, boolean read) throws GridCacheEntryRemovedException, GridDistributedLockCancelledException
tx
- Cache transaction.timeout
- Timeout for lock acquisition.serOrder
- Version for serializable transactions ordering.serReadVer
- Optional read entry version for optimistic serializable transaction.read
- Read lock flag.True
if lock was acquired, false
otherwise.GridCacheEntryRemovedException
- If this entry is obsolete.GridDistributedLockCancelledException
- If lock has been cancelled.public final void txUnlock(IgniteInternalTx tx) throws GridCacheEntryRemovedException
tx
- Cache transaction.GridCacheEntryRemovedException
- If this entry has been removed from cache.protected void checkCallbacks(boolean emptyBefore, boolean emptyAfter)
emptyBefore
- Empty flag before operation.emptyAfter
- Empty flag after operation.protected final void checkThreadChain(GridCacheMvccCandidate owner)
checkThreadChain
in class GridCacheMapEntry
owner
- Starting candidate in the chain.public String toString()
toString
in class GridCacheMapEntry
Follow @ApacheIgnite
Ignite Fabric : ver. 1.9.0 Release Date : March 2 2017