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) |
| Modifier and Type | Method and Description |
|---|---|
GridCacheMvccCandidate |
addLocal(GridCacheEntryEx parent,
long threadId,
GridCacheVersion ver,
long timeout,
boolean reenter,
boolean tx,
boolean implicitSingle,
boolean read) |
GridCacheMvccCandidate |
addLocal(GridCacheEntryEx parent,
UUID nearNodeId,
GridCacheVersion nearVer,
long threadId,
GridCacheVersion ver,
long timeout,
GridCacheVersion serOrder,
boolean reenter,
boolean tx,
boolean implicitSingle,
boolean dhtLoc,
boolean read) |
GridCacheMvccCandidate |
addNearLocal(GridCacheEntryEx parent,
UUID nodeId,
UUID otherNodeId,
long threadId,
GridCacheVersion ver,
boolean tx,
boolean implicitSingle,
boolean read)
Adds new near local lock candidate.
|
GridCacheMvccCandidate |
addRemote(GridCacheEntryEx parent,
UUID nodeId,
UUID otherNodeId,
long threadId,
GridCacheVersion ver,
boolean tx,
boolean implicitSingle,
boolean nearLoc)
Adds new remote lock candidate (either near remote or dht remote).
|
CacheLockCandidates |
allOwners() |
GridCacheMvccCandidate |
candidate(GridCacheVersion ver)
Gets candidate for lock ID.
|
CacheLockCandidates |
doneRemote(GridCacheVersion ver,
Collection<GridCacheVersion> pending,
Collection<GridCacheVersion> committed,
Collection<GridCacheVersion> rolledback)
Sets remote candidate to done.
|
boolean |
isEmpty(GridCacheVersion... exclude) |
GridCacheMvccCandidate |
localCandidate(UUID nodeId,
long threadId)
Near local candidate.
|
List<GridCacheMvccCandidate> |
localCandidates(boolean reentries,
GridCacheVersion... excludeVers) |
Collection<GridCacheMvccCandidate> |
localCandidates(GridCacheVersion... excludeVers) |
List<GridCacheMvccCandidate> |
localCandidatesNoCopy(boolean reentry) |
CacheLockCandidates |
localOwners() |
void |
markOwned(GridCacheVersion baseVer,
GridCacheVersion owned)
Puts owned versions in front of base.
|
void |
orderCompleted(GridCacheVersion baseVer,
Collection<GridCacheVersion> committedVers,
Collection<GridCacheVersion> rolledbackVers)
Moves completed candidates right before the base one.
|
CacheLockCandidates |
readyLocal(GridCacheMvccCandidate cand) |
CacheLockCandidates |
readyLocal(GridCacheVersion ver) |
CacheLockCandidates |
readyNearLocal(GridCacheVersion ver,
GridCacheVersion mappedVer,
Collection<GridCacheVersion> committedVers,
Collection<GridCacheVersion> rolledBackVers,
Collection<GridCacheVersion> pending)
Marks near-local candidate as ready and makes locks reassignment.
|
CacheLockCandidates |
recheck()
Checks if lock should be assigned.
|
GridCacheMvccCandidate |
releaseLocal()
Local local release.
|
GridCacheMvccCandidate |
releaseLocal(long threadId)
Local release.
|
List<GridCacheMvccCandidate> |
remoteCandidates(GridCacheVersion... excludeVers) |
void |
remove(GridCacheVersion ver)
Removes lock even if it is not owner.
|
CacheLockCandidates |
removeExplicitNodeCandidates(UUID nodeId)
Removes all candidates for node.
|
void |
salvageRemote(GridCacheVersion ver)
For all remote candidates standing behind the candidate being salvaged marks their transactions
as system invalidate and marks these candidates as owned and used.
|
String |
toString() |
public GridCacheMvcc(GridCacheContext<?,?> cctx)
cctx - Cache context.@Nullable public CacheLockCandidates allOwners()
@Nullable public CacheLockCandidates localOwners()
public boolean isEmpty(GridCacheVersion... exclude)
exclude - Versions to exclude form check.True if lock is empty.public void 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.public void 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, boolean read)
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.read - Read lock 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, boolean read)
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.read - Read lock flag.public GridCacheMvccCandidate addRemote(GridCacheEntryEx parent, UUID nodeId, @Nullable UUID otherNodeId, long threadId, GridCacheVersion ver, boolean tx, boolean implicitSingle, boolean nearLoc)
parent - Parent entry.nodeId - Node ID.otherNodeId - Other node ID.threadId - Thread ID.ver - Lock version.tx - Transaction flag.implicitSingle - Implicit flag.nearLoc - Near local flag.public GridCacheMvccCandidate addNearLocal(GridCacheEntryEx parent, UUID nodeId, @Nullable UUID otherNodeId, long threadId, GridCacheVersion ver, boolean tx, boolean implicitSingle, boolean read)
parent - Parent entry.nodeId - Node ID.otherNodeId - Other node ID.threadId - Thread ID.ver - Lock version.tx - Transaction flag.implicitSingle - Implicit flag.read - Read lock flag.@Nullable public CacheLockCandidates readyLocal(GridCacheVersion ver)
ver - Lock version to acquire or set to ready.@Nullable public CacheLockCandidates readyLocal(GridCacheMvccCandidate cand)
cand - Local candidate added in any of the addLocal(..) methods.@Nullable public CacheLockCandidates 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 CacheLockCandidates 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 CacheLockCandidates recheck()
@Nullable public GridCacheMvccCandidate releaseLocal()
@Nullable public GridCacheMvccCandidate releaseLocal(long threadId)
threadId - ID of the thread.public void remove(GridCacheVersion ver)
ver - Lock version.@Nullable public CacheLockCandidates removeExplicitNodeCandidates(UUID nodeId)
nodeId - Node ID.@Nullable public GridCacheMvccCandidate candidate(GridCacheVersion ver)
ver - Lock version.@Nullable public GridCacheMvccCandidate localCandidate(UUID nodeId, long threadId)
nodeId - Node ID.threadId - Thread ID.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.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017