org.apache.ignite.internal.processors.cache.distributed.dht.colocated

## Class GridDhtColocatedLockFuture

- java.lang.Object
- - java.util.concurrent.locks.AbstractOwnableSynchronizer
  - - java.util.concurrent.locks.AbstractQueuedSynchronizer
    - - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
      - - org.apache.ignite.internal.util.future.GridCompoundFuture<T,T>
        - - org.apache.ignite.internal.util.future.GridCompoundIdentityFuture<Boolean>
          - - org.apache.ignite.internal.processors.cache.distributed.dht.colocated.GridDhtColocatedLockFuture

All Implemented Interfaces:
  Serializable, IgniteInternalFuture<Boolean>, GridCacheFuture<Boolean>, GridCacheMvccFuture<Boolean>, IgniteInClosure<IgniteInternalFuture<Boolean>>

    public final class GridDhtColocatedLockFuture
    extends GridCompoundIdentityFuture<Boolean>
    implements GridCacheMvccFuture<Boolean>

Colocated cache lock future.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`AbstractQueuedSynchronizer.ConditionObject`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.util.future.GridCompoundFuture

`futs`

### Constructor Summary

Constructors
Constructor and Description
`GridDhtColocatedLockFuture(GridCacheContext<?,?> cctx, Collection<KeyCacheObject> keys, GridNearTxLocal tx, boolean read, boolean retval, long timeout, long accessTtl, CacheEntryPredicate[] filter, boolean skipStore, boolean keepBinary)`

### Method Summary

Methods
`boolean` `cancel()` Default no-op implementation that always returns `false`.
`void` `complete(boolean success)`
`IgniteUuid` `futureId()`
`int` `hashCode()`
`void` `markNotTrackable()` Marks this future as non-trackable.
`boolean` `onDone(Boolean success, Throwable err)` Callback to notify that future is finished.
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`boolean` `onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)`
`Set<KeyCacheObject>` `requestedKeys()`
`String` `toString()`
`boolean` `trackable()`
`GridCacheVersion` `version()`

### Methods inherited from class org.apache.ignite.internal.util.future.GridCompoundFuture

`add, apply, futures, futuresSize, hasPending, ignoreFailure, initialized, markInitialized`

### Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter

`chain, duration, endTime, error, get, get, get, get0, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, onCancelled, onDone, onDone, onDone, result, startTime, tryAcquireShared, tryReleaseShared`

### Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`acquire, 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, tryRelease`

### Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer

`getExclusiveOwnerThread, setExclusiveOwnerThread`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.ignite.internal.IgniteInternalFuture

`chain, duration, error, get, get, get, getUninterruptibly, isCancelled, isDone, listen, result, startTime`

### Constructor Detail

#### GridDhtColocatedLockFuture

    public GridDhtColocatedLockFuture(GridCacheContext<?,?> cctx,
                              Collection<KeyCacheObject> keys,
                              @Nullable
                              GridNearTxLocal tx,
                              boolean read,
                              boolean retval,
                              long timeout,
                              long accessTtl,
                              CacheEntryPredicate[] filter,
                              boolean skipStore,
                              boolean keepBinary)

Parameters:
  `cctx` - Registry.
  `keys` - Keys to lock.
  `tx` - Transaction.
  `read` - Read flag.
  `retval` - Flag to return value or not.
  `timeout` - Lock acquisition timeout.
  `accessTtl` - TTL for read operation.
  `filter` - Filter.
  `skipStore` - Skip store flag.

### Method Detail

#### version

    public GridCacheVersion version()

Specified by:
  `version` in interface `GridCacheMvccFuture<Boolean>`
Returns:
  Future version.

#### onOwnerChanged

    public boolean onOwnerChanged(GridCacheEntryEx entry,
                         GridCacheMvccCandidate owner)

Specified by:
  `onOwnerChanged` in interface `GridCacheMvccFuture<Boolean>`
Parameters:
  `entry` - Entry which received new owner.
  `owner` - Owner.
Returns:
  `True` if future cares about this entry.

#### futureId

    public IgniteUuid futureId()

Specified by:
  `futureId` in interface `GridCacheFuture<Boolean>`
Returns:
  Future ID.

#### trackable

    public boolean trackable()

Specified by:
  `trackable` in interface `GridCacheFuture<Boolean>`
Returns:
  `True` if future should be tracked.

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

Specified by:
  `markNotTrackable` in interface `GridCacheFuture<Boolean>`

#### complete

    public void complete(boolean success)

Parameters:
  `success` - Success flag.

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Description copied from interface: `GridCacheFuture`
Callback for when node left.

Specified by:
  `onNodeLeft` in interface `GridCacheFuture<Boolean>`
Parameters:
  `nodeId` - Left node ID
Returns:
  `True` if node was in the list.

#### requestedKeys

    public Set<KeyCacheObject> requestedKeys()

Returns:
  Keys for which locks requested from remote nodes but response isn't received.

#### cancel

    public boolean cancel()

Default no-op implementation that always returns `false`. Futures that do support cancellation should override this method and call `GridFutureAdapter.onCancelled()` callback explicitly if cancellation indeed did happen.

Specified by:
  `cancel` in interface `IgniteInternalFuture<Boolean>`
Overrides:
  `cancel` in class `GridCompoundFuture<Boolean,Boolean>`
Returns:
  `True` if future was canceled (i.e. was not finished prior to this call).

#### onDone

    public boolean onDone(Boolean success,
                 Throwable err)

Callback to notify that future is finished. Note that if non-`null` exception is passed in the result value will be ignored.

Overrides:
  `onDone` in class `GridFutureAdapter<Boolean>`
Parameters:
  `success` - Optional result.
  `err` - Optional error.
Returns:
  `True` if result was set by this call.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCompoundIdentityFuture<Boolean>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016