public final class GridCacheMvcc extends Object
GridCacheVersionManager.next() for information on how lock IDs are
generated to prevent starvation.| Constructor and Description |
|---|
GridCacheMvcc(GridCacheContext<?,?> cctx) |
public GridCacheMvcc(GridCacheContext<?,?> cctx)
cctx - Cache context.@Nullable public GridCacheMvccCandidate anyOwner()
@Nullable public GridCacheMvccCandidate remoteOwner()
@Nullable public GridCacheMvccCandidate localOwner()
public boolean isEmpty(GridCacheVersion... exclude)
exclude - Versions to exclude form check.True if lock is empty.@Nullable public GridCacheMvccCandidate orderCompleted(GridCacheVersion baseVer, Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers)
false is
returned.baseVer - Base version.committedVers - Committed versions relative to base.rolledbackVers - Rolled back versions relative to base.@Nullable public GridCacheMvccCandidate markOwned(GridCacheVersion baseVer, GridCacheVersion owned)
baseVer - Base version.owned - Owned list.@Nullable public GridCacheMvccCandidate addLocal(GridCacheEntryEx parent, long threadId, GridCacheVersion ver, long timeout, boolean reenter, boolean tx, boolean implicitSingle)
parent - Parent entry.threadId - Thread ID.ver - Lock version.timeout - Lock acquisition timeout.reenter - Reentry flag (true if reentry is allowed).tx - Transaction flag.implicitSingle - Implicit transaction flag.@Nullable public GridCacheMvccCandidate addLocal(GridCacheEntryEx parent, @Nullable UUID nearNodeId, @Nullable GridCacheVersion nearVer, long threadId, GridCacheVersion ver, long timeout, @Nullable GridCacheVersion serOrder, boolean reenter, boolean tx, boolean implicitSingle, boolean dhtLoc)
parent - Parent entry.nearNodeId - Near node ID.nearVer - Near version.threadId - Thread ID.ver - Lock version.timeout - Lock acquisition timeout.serOrder - Version for serializable transactions ordering.reenter - Reentry flag (true if reentry is allowed).tx - Transaction flag.implicitSingle - Implicit flag.dhtLoc - DHT local flag.public GridCacheMvccCandidate addRemote(GridCacheEntryEx parent, UUID nodeId, @Nullable UUID otherNodeId, long threadId, GridCacheVersion ver, long timeout, boolean tx, boolean implicitSingle, boolean nearLoc)
parent - Parent entry.nodeId - Node ID.otherNodeId - Other node ID.threadId - Thread ID.ver - Lock version.timeout - Lock acquire timeout.tx - Transaction flag.implicitSingle - Implicit flag.nearLoc - Near local flag.public GridCacheMvccCandidate addNearLocal(GridCacheEntryEx parent, UUID nodeId, @Nullable UUID otherNodeId, long threadId, GridCacheVersion ver, long timeout, boolean tx, boolean implicitSingle)
parent - Parent entry.nodeId - Node ID.otherNodeId - Other node ID.threadId - Thread ID.ver - Lock version.timeout - Lock acquire timeout.tx - Transaction flag.implicitSingle - Implicit flag.public void addRemote(GridCacheMvccCandidate cand)
cand - Remote candidate.@Nullable public GridCacheMvccCandidate readyLocal(GridCacheVersion ver)
ver - Lock version to acquire or set to ready.@Nullable public GridCacheMvccCandidate readyLocal(GridCacheMvccCandidate cand)
cand - Local candidate added in any of the addLocal(..) methods.@Nullable public GridCacheMvccCandidate readyNearLocal(GridCacheVersion ver, GridCacheVersion mappedVer, Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledBackVers, Collection<GridCacheVersion> pending)
ver - Version to mark as ready.mappedVer - Mapped dht version.committedVers - Committed versions.rolledBackVers - Rolled back versions.pending - Pending dht versions that are not owned and which version is less then mapped.@Nullable public GridCacheMvccCandidate doneRemote(GridCacheVersion ver, Collection<GridCacheVersion> pending, Collection<GridCacheVersion> committed, Collection<GridCacheVersion> rolledback)
ver - Version.pending - Pending versions.committed - Committed versions.rolledback - Rolledback versions.public void salvageRemote(GridCacheVersion ver)
ver - Version to salvage.@Nullable public GridCacheMvccCandidate recheck()
@Nullable public GridCacheMvccCandidate releaseLocal()
@Nullable public GridCacheMvccCandidate releaseLocal(long threadId)
threadId - ID of the thread.@Nullable public GridCacheMvccCandidate remove(GridCacheVersion ver)
ver - Lock version.@Nullable public GridCacheMvccCandidate removeExplicitNodeCandidates(UUID nodeId)
nodeId - Node ID.@Nullable public GridCacheMvccCandidate candidate(GridCacheVersion ver)
ver - Lock version.@Nullable public GridCacheMvccCandidate localCandidate(long threadId)
threadId - Thread ID.@Nullable public GridCacheMvccCandidate remoteCandidate(UUID nodeId, long threadId)
nodeId - Node ID.threadId - Thread ID.@Nullable public GridCacheMvccCandidate localCandidate(UUID nodeId, long threadId)
nodeId - Node ID.threadId - Thread ID.public boolean hasCandidate(GridCacheVersion ver)
ver - Version.True if candidate with given version exists.public List<GridCacheMvccCandidate> localCandidatesNoCopy(boolean reentry)
reentry - Reentry flag.public Collection<GridCacheMvccCandidate> localCandidates(GridCacheVersion... excludeVers)
excludeVers - Exclude versions.public List<GridCacheMvccCandidate> localCandidates(boolean reentries, GridCacheVersion... excludeVers)
reentries - Flag to include reentries.excludeVers - Exclude versions.public List<GridCacheMvccCandidate> remoteCandidates(GridCacheVersion... excludeVers)
excludeVers - Exclude versions.public boolean isLocallyOwnedByCurrentThread()
True if lock is owner by current thread.public boolean isLocallyOwnedByThread(long threadId,
boolean allowDhtLoc,
GridCacheVersion... exclude)
threadId - Thread ID to check.exclude - Versions to ignore.True if lock is owned by the thread with given ID.public boolean isLockedByThread(long threadId,
UUID nodeId)
threadId - Thread ID.nodeId - Node ID.True if lock is held by given thread and node IDs.public boolean isOwnedByAny()
True if lock is owned by any thread or node.public boolean isLocallyOwned(GridCacheVersion lockVer)
lockVer - ID of lock candidate.True if candidate is owner.public boolean isLocallyOwnedByIdOrThread(GridCacheVersion lockVer, long threadId)
lockVer - Lock ID.threadId - Thread ID.True if locked by lock ID or thread ID.@Nullable public GridCacheMvccCandidate firstRemote()
@Nullable public GridCacheMvccCandidate firstLocal()
@Nullable public List<GridCacheMvccCandidate> allLocal()
public boolean isOwnedBy(GridCacheVersion ver)
ver - Version to check for ownership.True if lock is owned by the specified version.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.7.0 Release Date : August 1 2016