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

## Class GridDhtAtomicAbstractUpdateFuture

- java.lang.Object
- - java.util.concurrent.locks.AbstractOwnableSynchronizer
  - - java.util.concurrent.locks.AbstractQueuedSynchronizer
    - - org.apache.ignite.internal.util.future.GridFutureAdapter<Void>
      - - org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateFuture

All Implemented Interfaces:
  Serializable, IgniteInternalFuture<Void>, GridCacheAtomicFuture<Void>, GridCacheFuture<Void>

    public abstract class GridDhtAtomicAbstractUpdateFuture
    extends GridFutureAdapter<Void>
    implements GridCacheAtomicFuture<Void>

DHT atomic cache backup update future.

See Also:
  Serialized Form

### Nested Class Summary

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

`AbstractQueuedSynchronizer.ConditionObject`

### Field Summary

Fields
`protected GridCacheContext` `cctx` Cache context.
`protected GridCacheVersion` `futVer` Future version.
`protected static IgniteLogger` `log` Logger.
`protected Map<UUID,GridDhtAtomicAbstractUpdateRequest>` `mappings` Mappings.
`protected static IgniteLogger` `msgLog` Logger.
`protected GridNearAtomicAbstractUpdateRequest` `updateReq` Update request.
`protected GridCacheVersion` `writeVer` Write version.

### Constructor Summary

Constructors
`protected` `GridDhtAtomicAbstractUpdateFuture(GridCacheContext cctx, CI2<GridNearAtomicAbstractUpdateRequest,GridNearAtomicUpdateResponse> completionCb, GridCacheVersion writeVer, GridNearAtomicAbstractUpdateRequest updateReq, GridNearAtomicUpdateResponse updateRes)`

### Method Summary

Methods
`void` `addContinuousQueryClosure(CI1<Boolean> clsr)`
`protected abstract void` `addDhtKey(KeyCacheObject key, List<ClusterNode> dhtNodes)`
`protected abstract void` `addFailedKeys(GridNearAtomicUpdateResponse updateRes, Throwable err)`
`protected abstract void` `addNearKey(KeyCacheObject key, Collection<UUID> readers)`
`protected abstract void` `addNearReaderEntry(GridDhtCacheEntry entry)` adds new nearReader.
`IgniteInternalFuture<Void>` `completeFuture(AffinityTopologyVersion topVer)` Gets future that will be completed when it is safe when update is finished on the given version of topology.
`protected abstract GridDhtAtomicAbstractUpdateRequest` `createRequest(ClusterNode node, GridCacheVersion futVer, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, AffinityTopologyVersion topVer, long ttl, long conflictExpireTime, GridCacheVersion conflictVer)`
`IgniteUuid` `futureId()`
`void` `markNotTrackable()` Marks this future as non-trackable.
`boolean` `onDone(Void res, Throwable err)` Callback to notify that future is finished.
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`void` `onResult(UUID nodeId)` Deferred update response.
`abstract void` `onResult(UUID nodeId, GridDhtAtomicUpdateResponse updateRes)` Callback for backup update response.
`boolean` `trackable()`
`GridCacheVersion` `version()`

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

`cancel, chain, duration, endTime, error, get, get, get, get0, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, onDone, onDone, result, startTime, toString, 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, hashCode, notify, notifyAll, wait, wait, wait`

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

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

### Field Detail

#### log

    protected static IgniteLogger log

Logger.

#### msgLog

    protected static IgniteLogger msgLog

Logger.

#### writeVer

    protected final GridCacheVersion writeVer

Write version.

#### cctx

    protected final GridCacheContext cctx

Cache context.

#### futVer

    protected final GridCacheVersion futVer

Future version.

#### updateReq

    protected final GridNearAtomicAbstractUpdateRequest updateReq

Update request.

#### mappings

    @GridToStringInclude
    protected Map<UUID,GridDhtAtomicAbstractUpdateRequest> mappings

Mappings.

### Constructor Detail

#### GridDhtAtomicAbstractUpdateFuture

    protected GridDhtAtomicAbstractUpdateFuture(GridCacheContext cctx,
                                     CI2<GridNearAtomicAbstractUpdateRequest,GridNearAtomicUpdateResponse> completionCb,
                                     GridCacheVersion writeVer,
                                     GridNearAtomicAbstractUpdateRequest updateReq,
                                     GridNearAtomicUpdateResponse updateRes)

Parameters:
  `cctx` - Cache context.
  `completionCb` - Callback to invoke when future is completed.
  `writeVer` - Write version.
  `updateReq` - Update request.
  `updateRes` - Update response.

### Method Detail

#### completeFuture

    public final IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer)

Gets future that will be completed when it is safe when update is finished on the given version of topology.

Specified by:
  `completeFuture` in interface `GridCacheAtomicFuture<Void>`
Parameters:
  `topVer` - Topology version to finish.
Returns:
  Future or `null` if no need to wait.

#### addContinuousQueryClosure

    public final void addContinuousQueryClosure(CI1<Boolean> clsr)

Parameters:
  `clsr` - Continuous query closure.

#### addDhtKey

    protected abstract void addDhtKey(KeyCacheObject key,
                 List<ClusterNode> dhtNodes)

Parameters:
  `key` - Key.
  `dhtNodes` - DHT nodes.

#### addNearKey

    protected abstract void addNearKey(KeyCacheObject key,
                  Collection<UUID> readers)

Parameters:
  `key` - Key.
  `readers` - Near cache readers.

#### addNearReaderEntry

    protected abstract void addNearReaderEntry(GridDhtCacheEntry entry)

adds new nearReader.

Parameters:
  `entry` - GridDhtCacheEntry.

#### futureId

    public final IgniteUuid futureId()

Specified by:
  `futureId` in interface `GridCacheFuture<Void>`
Returns:
  Unique identifier for this future.

#### version

    public final GridCacheVersion version()

Specified by:
  `version` in interface `GridCacheAtomicFuture<Void>`
Returns:
  Future version.

#### onNodeLeft

    public final boolean onNodeLeft(UUID nodeId)

Callback for when node left.

Specified by:
  `onNodeLeft` in interface `GridCacheFuture<Void>`
Parameters:
  `nodeId` - Left node ID.
Returns:
  `True` if future cared about this node.

#### onResult

    public final void onResult(UUID nodeId)

Deferred update response.

Parameters:
  `nodeId` - Backup node ID.

#### createRequest

    protected abstract GridDhtAtomicAbstractUpdateRequest createRequest(ClusterNode node,
                                                   GridCacheVersion futVer,
                                                   GridCacheVersion writeVer,
                                                   CacheWriteSynchronizationMode syncMode,
                                                   @NotNull
                                                   AffinityTopologyVersion topVer,
                                                   long ttl,
                                                   long conflictExpireTime,
                                                   @Nullable
                                                   GridCacheVersion conflictVer)

Parameters:
  `node` - Node.
  `futVer` - Future version.
  `writeVer` - Update version.
  `syncMode` - Write synchronization mode.
  `topVer` - Topology version.
  `ttl` - TTL.
  `conflictExpireTime` - Conflict expire time.
  `conflictVer` - Conflict version.
Returns:
  Request.

#### onResult

    public abstract void onResult(UUID nodeId,
                GridDhtAtomicUpdateResponse updateRes)

Callback for backup update response.

Parameters:
  `nodeId` - Backup node ID.
  `updateRes` - Update response.

#### addFailedKeys

    protected abstract void addFailedKeys(GridNearAtomicUpdateResponse updateRes,
                     Throwable err)

Parameters:
  `updateRes` - Response.
  `err` - Error.

#### onDone

    public final boolean onDone(@Nullable
                 Void res,
                 @Nullable
                 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<Void>`
Parameters:
  `res` - Optional result.
  `err` - Optional error.
Returns:
  `True` if result was set by this call.

#### trackable

    public boolean trackable()

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

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016