public class GridCacheExplicitLockSpan extends ReentrantLock
| Constructor and Description |
|---|
GridCacheExplicitLockSpan(AffinityTopologyVersion topVer,
GridCacheMvccCandidate cand) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCandidate(AffinityTopologyVersion topVer,
GridCacheMvccCandidate cand)
Adds candidate to a lock span.
|
@Nullable GridCacheMvccCandidate |
candidate(IgniteTxKey key,
@Nullable GridCacheVersion ver)
Gets explicit lock candidate for given key.
|
boolean |
isEmpty() |
void |
markOwned(IgniteTxKey key)
Marks all candidates added for given key as owned.
|
IgniteInternalFuture<Object> |
releaseFuture()
Gets span release future.
|
boolean |
removeCandidate(GridCacheMvccCandidate cand)
Removes candidate from this lock span.
|
GridCacheMvccCandidate |
removeCandidate(IgniteTxKey key,
@Nullable GridCacheVersion ver)
Removes lock by key and optional version.
|
@Nullable AffinityTopologyVersion |
topologyVersion()
Gets actual topology snapshot for thread lock span.
|
String |
toString() |
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, tryLock, tryLock, unlockpublic GridCacheExplicitLockSpan(AffinityTopologyVersion topVer, GridCacheMvccCandidate cand)
topVer - Topology version.cand - Candidate.public boolean addCandidate(AffinityTopologyVersion topVer, GridCacheMvccCandidate cand)
topVer - Topology snapshot for which candidate is added.cand - Candidate to add.True if candidate was added, false if this span is empty and
new span should be created.public boolean removeCandidate(GridCacheMvccCandidate cand)
cand - Candidate to remove.True if span is empty and should be removed, false otherwise.public GridCacheMvccCandidate removeCandidate(IgniteTxKey key, @Nullable @Nullable GridCacheVersion ver)
key - Key.ver - Version (or null if any candidate should be removed.)public boolean isEmpty()
True if span is empty and candidates cannot be added anymore.public void markOwned(IgniteTxKey key)
key - Key.@Nullable public @Nullable GridCacheMvccCandidate candidate(IgniteTxKey key, @Nullable @Nullable GridCacheVersion ver)
key - Key to lookup.ver - Version to lookup (if null - return any).null.@Nullable public @Nullable AffinityTopologyVersion topologyVersion()
null if candidate list is empty.public IgniteInternalFuture<Object> releaseFuture()
public String toString()
toString in class ReentrantLock
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023