public final class GridDhtLockFuture<K,V> extends GridCompoundIdentityFuture<Boolean> implements GridCacheMvccFuture<K,V,Boolean>, GridDhtFuture<Boolean>, GridCacheMappedVersion
AbstractQueuedSynchronizer.ConditionObjectctx| Constructor and Description |
|---|
GridDhtLockFuture()
Empty constructor required by
Externalizable. |
GridDhtLockFuture(GridCacheContext<K,V> cctx,
UUID nearNodeId,
GridCacheVersion nearLockVer,
long topVer,
int cnt,
boolean read,
long timeout,
GridDhtTxLocalAdapter<K,V> tx,
long threadId,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
| Modifier and Type | Method and Description |
|---|---|
GridCacheMvccCandidate<K> |
addEntry(GridDhtCacheEntry<K,V> entry)
Adds entry to future.
|
boolean |
cancel()
Default no-op implementation that always returns
false. |
Collection<GridDhtCacheEntry<K,V>> |
entries() |
Collection<GridDhtCacheEntry<K,V>> |
entriesCopy() |
GridUuid |
futureId() |
int |
hashCode() |
Collection<Integer> |
invalidPartitions()
Node that future should be able to provide keys to retry before
it completes, so it's not necessary to wait till future is done
to get retry keys.
|
void |
map() |
GridCacheVersion |
mappedVersion()
Mapping should occur only if this interface returns a non-null value.
|
void |
markNotTrackable()
Marks this future as non-trackable.
|
GridCacheVersion |
nearLockVersion() |
Collection<? extends GridNode> |
nodes() |
boolean |
onDone(Boolean success,
Throwable err)
Callback to notify that future is finished.
|
void |
onError(GridDistributedLockCancelledException e) |
void |
onError(Throwable t) |
boolean |
onNodeLeft(UUID nodeId)
Callback for when node left.
|
boolean |
onOwnerChanged(GridCacheEntryEx<K,V> entry,
GridCacheMvccCandidate<K> owner)
Callback for whenever entry lock ownership changes.
|
String |
toString() |
boolean |
trackable() |
GridCacheVersion |
version() |
add, addAll, addAll, futures, hasPending, ignoreChildFailures, initialized, markInitialized, pending, reducer, reducerchain, checkValid, concurrentNotify, concurrentNotify, duration, endTime, error, get, get, get, get0, isCancelled, isDone, isFailed, isValid, listenAsync, onCancelled, onDone, onDone, onDone, readExternal, result, startTime, stopListenAsync, syncNotify, syncNotify, tryAcquireShared, tryReleaseShared, writeExternalacquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryReleasegetExclusiveOwnerThread, setExclusiveOwnerThreadclone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitchain, concurrentNotify, concurrentNotify, duration, get, get, get, isCancelled, isDone, listenAsync, startTime, stopListenAsync, syncNotify, syncNotifypublic GridDhtLockFuture()
Externalizable.public GridDhtLockFuture(GridCacheContext<K,V> cctx, UUID nearNodeId, GridCacheVersion nearLockVer, long topVer, int cnt, boolean read, long timeout, GridDhtTxLocalAdapter<K,V> tx, long threadId, GridPredicate<GridCacheEntry<K,V>>[] filter)
cctx - Cache context.nearNodeId - Near node ID.nearLockVer - Near lock version.topVer - Topology version.cnt - Number of keys to lock.read - Read flag.timeout - Lock acquisition timeout.tx - Transaction.threadId - Thread ID.filter - Filter.public Collection<Integer> invalidPartitions()
invalidPartitions in interface GridDhtFuture<Boolean>public Collection<? extends GridNode> nodes()
nodes in interface GridCacheFuture<Boolean>public GridCacheVersion version()
version in interface GridCacheFuture<Boolean>public boolean trackable()
trackable in interface GridCacheFuture<Boolean>True if future should be tracked.public void markNotTrackable()
markNotTrackable in interface GridCacheFuture<Boolean>public Collection<GridDhtCacheEntry<K,V>> entries()
public Collection<GridDhtCacheEntry<K,V>> entriesCopy()
public GridUuid futureId()
futureId in interface GridCacheFuture<Boolean>public GridCacheVersion nearLockVersion()
@Nullable public GridCacheVersion mappedVersion()
mappedVersion in interface GridCacheMappedVersion@Nullable public GridCacheMvccCandidate<K> addEntry(GridDhtCacheEntry<K,V> entry) throws GridCacheEntryRemovedException, GridDistributedLockCancelledException
entry - Entry to add.GridCacheEntryRemovedException - If entry was removed.GridDistributedLockCancelledException - If lock is canceled.public boolean onNodeLeft(UUID nodeId)
GridCacheFutureonNodeLeft in interface GridCacheFuture<Boolean>nodeId - Left node IDTrue if node was in the list.public void onError(GridDistributedLockCancelledException e)
e - Error.public void onError(Throwable t)
t - Error.public boolean onOwnerChanged(GridCacheEntryEx<K,V> entry, GridCacheMvccCandidate<K> owner)
onOwnerChanged in interface GridCacheMvccFuture<K,V,Boolean>entry - Entry whose lock ownership changed.owner - Owner.True if future cares about this entry.public boolean cancel()
false.
Futures that do support cancellation should override this method
and call GridFutureAdapter.onCancelled() callback explicitly if cancellation
indeed did happen.cancel in interface GridFuture<Boolean>cancel in class GridCompoundFuture<Boolean,Boolean>True if future was canceled (i.e. was not finished prior to this call).public boolean onDone(@Nullable Boolean success, @Nullable Throwable err)
null exception is passed in
the result value will be ignored.onDone in class GridFutureAdapter<Boolean>success - Optional result.err - Optional error.True if result was set by this call.public void map()
public String toString()
toString in class GridCompoundIdentityFuture<Boolean>Copyright © 2014. All rights reserved.