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

## Class GridNearAtomicUpdateFuture

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

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

    public class GridNearAtomicUpdateFuture
    extends GridNearAtomicAbstractUpdateFuture

DHT atomic cache near 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 inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateFuture

`cache, cctx, err, expiryPlc, filter, futVer, invokeArgs, keepBinary, log, mapErrTopVer, msgLog, mux, nearEnabled, op, opRes, rawRetval, remapCnt, resCnt, retval, skipStore, subjId, syncMode, taskNameHash, topCompleteFut, topLocked, topVer, updVer, waitTopFut`

### Constructor Summary

Constructors
Constructor and Description

`GridNearAtomicUpdateFuture(GridCacheContext cctx, GridDhtAtomicCache cache, CacheWriteSynchronizationMode syncMode, GridCacheOperation op, Collection<?> keys, Collection<?> vals, Object[] invokeArgs, Collection<GridCacheDrInfo> conflictPutVals, Collection<GridCacheVersion> conflictRmvVals, boolean retval, boolean rawRetval, javax.cache.expiry.ExpiryPolicy expiryPlc, CacheEntryPredicate[] filter, UUID subjId, int taskNameHash, boolean skipStore, boolean keepBinary, int remapCnt, boolean waitTopFut)`

### Method Summary

Methods
`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 void` `map(AffinityTopologyVersion topVer)`
`protected void` `mapOnTopology()` Maps future on ready topology.
`boolean` `onDone(Object res, Throwable err)` Callback to notify that future is finished.
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`void` `onResult(UUID nodeId, GridNearAtomicUpdateResponse res, boolean nodeErr)` Response callback.
`String` `toString()`
`GridCacheVersion` `version()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateFuture

`futureId, map, markNotTrackable, storeFuture, trackable`

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

### Constructor Detail

#### GridNearAtomicUpdateFuture

    public GridNearAtomicUpdateFuture(GridCacheContext cctx,
                              GridDhtAtomicCache cache,
                              CacheWriteSynchronizationMode syncMode,
                              GridCacheOperation op,
                              Collection<?> keys,
                              @Nullable
                              Collection<?> vals,
                              @Nullable
                              Object[] invokeArgs,
                              @Nullable
                              Collection<GridCacheDrInfo> conflictPutVals,
                              @Nullable
                              Collection<GridCacheVersion> conflictRmvVals,
                              boolean retval,
                              boolean rawRetval,
                              @Nullable
                              javax.cache.expiry.ExpiryPolicy expiryPlc,
                              CacheEntryPredicate[] filter,
                              UUID subjId,
                              int taskNameHash,
                              boolean skipStore,
                              boolean keepBinary,
                              int remapCnt,
                              boolean waitTopFut)

Parameters:
  `cctx` - Cache context.
  `cache` - Cache instance.
  `syncMode` - Write synchronization mode.
  `op` - Update operation.
  `keys` - Keys to update.
  `vals` - Values or transform closure.
  `invokeArgs` - Optional arguments for entry processor.
  `conflictPutVals` - Conflict put values (optional).
  `conflictRmvVals` - Conflict remove values (optional).
  `retval` - Return value require flag.
  `rawRetval` - `True` if should return `GridCacheReturn` as future result.
  `expiryPlc` - Expiry policy explicitly specified for cache operation.
  `filter` - Entry filter.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash code.
  `skipStore` - Skip store flag.
  `keepBinary` - Keep binary flag.
  `remapCnt` - Maximum number of retries.
  `waitTopFut` - If `false` does not wait for affinity change future.

### Method Detail

#### version

    public GridCacheVersion version()

Returns:
  Future version.

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Callback for when node left.

Parameters:
  `nodeId` - Left node ID.
Returns:
  `True` if future cared about this node.

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

Parameters:
  `topVer` - Topology version to finish.
Returns:
  Future or `null` if no need to wait.

#### onDone

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

#### onResult

    public void onResult(UUID nodeId,
                GridNearAtomicUpdateResponse res,
                boolean nodeErr)

Response callback.

Parameters:
  `nodeId` - Node ID.
  `res` - Update response.
  `nodeErr` - `True` if response was created on node failure.

#### mapOnTopology

    protected void mapOnTopology()

Maps future on ready topology.

Specified by:
  `mapOnTopology` in class `GridNearAtomicAbstractUpdateFuture`

#### map

    protected void map(AffinityTopologyVersion topVer)

Specified by:
  `map` in class `GridNearAtomicAbstractUpdateFuture`
Parameters:
  `topVer` - Topology version.

#### toString

    public String toString()

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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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