public class GridCacheExplicitLockSpan<K> extends ReentrantLock
| Constructor and Description |
|---|
GridCacheExplicitLockSpan(GridDiscoveryTopologySnapshot topSnapshot,
GridCacheMvccCandidate<K> cand) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCandidate(GridDiscoveryTopologySnapshot topSnapshot,
GridCacheMvccCandidate<K> cand)
Adds candidate to a lock span.
|
GridCacheMvccCandidate<K> |
candidate(K key,
GridCacheVersion ver)
Gets explicit lock candidate for given key.
|
boolean |
isEmpty() |
void |
markOwned(K key)
Marks all candidates added for given key as owned.
|
IgniteInternalFuture<Object> |
releaseFuture()
Gets span release future.
|
boolean |
removeCandidate(GridCacheMvccCandidate<K> cand)
Removes candidate from this lock span.
|
GridCacheMvccCandidate<K> |
removeCandidate(K 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<K> cand)
topSnapshot - Topology snapshot.cand - Candidate.public boolean addCandidate(GridDiscoveryTopologySnapshot topSnapshot, GridCacheMvccCandidate<K> 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<K> cand)
cand - Candidate to remove.True if span is empty and should be removed, false otherwise.public GridCacheMvccCandidate<K> removeCandidate(K 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(K key)
key - Key.@Nullable public GridCacheMvccCandidate<K> candidate(K 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-RC1 Release Date : February 17 2015