public class GridCacheExplicitLockSpan extends ReentrantLock
| Constructor and Description |
|---|
GridCacheExplicitLockSpan(GridDiscoveryTopologySnapshot topSnapshot,
GridCacheMvccCandidate cand) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCandidate(GridDiscoveryTopologySnapshot topSnapshot,
GridCacheMvccCandidate cand)
Adds candidate to a lock span.
|
GridCacheMvccCandidate |
candidate(KeyCacheObject key,
GridCacheVersion ver)
Gets explicit lock candidate for given key.
|
boolean |
isEmpty() |
void |
markOwned(KeyCacheObject 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(KeyCacheObject key,
GridCacheVersion ver)
Removes lock by key and optional version.
|
GridDiscoveryTopologySnapshot |
topologySnapshot()
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(GridDiscoveryTopologySnapshot topSnapshot, GridCacheMvccCandidate cand)
topSnapshot - Topology snapshot.cand - Candidate.public boolean addCandidate(GridDiscoveryTopologySnapshot topSnapshot, GridCacheMvccCandidate cand)
topSnapshot - 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(KeyCacheObject key, @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(KeyCacheObject key)
key - Key.@Nullable public GridCacheMvccCandidate candidate(KeyCacheObject key, @Nullable GridCacheVersion ver)
key - Key to lookup.ver - Version to lookup (if null - return any).null.@Nullable public GridDiscoveryTopologySnapshot topologySnapshot()
null if candidate list is empty.public IgniteInternalFuture<Object> releaseFuture()
public String toString()
toString in class ReentrantLock
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015