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

## Class GridDhtAtomicUpdateFuture

- 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.GridDhtAtomicUpdateFuture

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

    public class GridDhtAtomicUpdateFuture
    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 static IgniteLogger` `log` Logger.

### Constructor Summary

Constructors
Constructor and Description
`GridDhtAtomicUpdateFuture(GridCacheContext cctx, CI2<GridNearAtomicUpdateRequest,GridNearAtomicUpdateResponse> completionCb, GridCacheVersion writeVer, GridNearAtomicUpdateRequest updateReq, GridNearAtomicUpdateResponse updateRes)`

### Method Summary

Methods
`void` `addNearWriteEntries(Iterable<UUID> readers, GridDhtCacheEntry entry, CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long expireTime)`
`void` `addWriteEntry(GridDhtCacheEntry entry, CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long conflictExpireTime, GridCacheVersion conflictVer)`
`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.
`IgniteUuid` `futureId()`
`Collection<KeyCacheObject>` `keys()`
`void` `map()` Sends requests to remote nodes.
`void` `markNotTrackable()` Marks this future as non-trackable.
`Collection<? extends ClusterNode>` `nodes()`
`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.
`void` `onResult(UUID nodeId, GridDhtAtomicUpdateResponse updateRes)` Callback for backup update response.
`String` `toString()`
`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, 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, 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.

### Constructor Detail

#### GridDhtAtomicUpdateFuture

    public GridDhtAtomicUpdateFuture(GridCacheContext cctx,
                             CI2<GridNearAtomicUpdateRequest,GridNearAtomicUpdateResponse> completionCb,
                             GridCacheVersion writeVer,
                             GridNearAtomicUpdateRequest 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

#### futureId

    public IgniteUuid futureId()

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

#### version

    public GridCacheVersion version()

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

#### nodes

    public Collection<? extends ClusterNode> nodes()

Specified by:
  `nodes` in interface `GridCacheFuture<Void>`
Returns:
  Involved nodes.

#### onNodeLeft

    public 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.

#### 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>`

#### completeFuture

    public 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.

#### keys

    public Collection<KeyCacheObject> keys()

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

#### addWriteEntry

    public void addWriteEntry(GridDhtCacheEntry entry,
                     @Nullable
                     CacheObject val,
                     javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                     long ttl,
                     long conflictExpireTime,
                     @Nullable
                     GridCacheVersion conflictVer)

Parameters:
  `entry` - Entry to map.
  `val` - Value to write.
  `entryProcessor` - Entry processor.
  `ttl` - TTL (optional).
  `conflictExpireTime` - Conflict expire time (optional).
  `conflictVer` - Conflict version (optional).

#### addNearWriteEntries

    public void addNearWriteEntries(Iterable<UUID> readers,
                           GridDhtCacheEntry entry,
                           @Nullable
                           CacheObject val,
                           javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                           long ttl,
                           long expireTime)

Parameters:
  `readers` - Entry readers.
  `entry` - Entry.
  `val` - Value.
  `entryProcessor` - Entry processor..
  `ttl` - TTL for near cache update (optional).
  `expireTime` - Expire time for near cache update (optional).

#### onDone

    public 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.

#### map

    public void map()

Sends requests to remote nodes.

#### onResult

    public void onResult(UUID nodeId,
                GridDhtAtomicUpdateResponse updateRes)

Callback for backup update response.

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

#### onResult

    public void onResult(UUID nodeId)

Deferred update response.

Parameters:
  `nodeId` - Backup node ID.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridFutureAdapter<Void>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015