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

## Class GridNearAtomicAbstractUpdateFuture

- 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

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

Direct Known Subclasses:
  GridNearAtomicSingleUpdateFuture, GridNearAtomicUpdateFuture

    public abstract class GridNearAtomicAbstractUpdateFuture
    extends GridFutureAdapter<Object>
    implements GridCacheAtomicFuture<Object>

Base for near atomic update futures.

See Also:
  Serialized Form

### Nested Class Summary

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

`AbstractQueuedSynchronizer.ConditionObject`

### Field Summary

Fields
`protected GridDhtAtomicCache` `cache` Cache.
`protected GridCacheContext` `cctx` Cache context.
`protected CachePartialUpdateCheckedException` `err` Error.
`protected javax.cache.expiry.ExpiryPolicy` `expiryPlc` Expiry policy.
`protected CacheEntryPredicate[]` `filter` Optional filter.
`protected GridCacheVersion` `futVer` Future ID.
`protected Object[]` `invokeArgs` Optional arguments for entry processor.
`protected boolean` `keepBinary` Keep binary flag.
`protected static IgniteLogger` `log` Logger.
`protected AffinityTopologyVersion` `mapErrTopVer` Topology version when got mapping error.
`protected static IgniteLogger` `msgLog` Logger.
`protected Object` `mux` Mutex to synchronize state updates.
`protected boolean` `nearEnabled` Near cache flag.
`protected GridCacheOperation` `op` Update operation.
`protected GridCacheReturn` `opRes` Operation result.
`protected boolean` `rawRetval` Raw return value flag.
`protected int` `remapCnt` Remap count.
`protected int` `resCnt`
`protected boolean` `retval` Return value require flag.
`protected boolean` `skipStore` Skip store flag.
`protected UUID` `subjId` Subject ID.
`protected CacheWriteSynchronizationMode` `syncMode` Write synchronization mode.
`protected int` `taskNameHash` Task name hash.
`protected GridFutureAdapter<Void>` `topCompleteFut` Completion future for a particular topology version.
`protected boolean` `topLocked` Topology locked flag.
`protected AffinityTopologyVersion` `topVer` Current topology version.
`protected GridCacheVersion` `updVer`
`protected boolean` `waitTopFut` Wait for topology future flag.

### Constructor Summary

Constructors

`protected`

`GridNearAtomicAbstractUpdateFuture(GridCacheContext cctx, GridDhtAtomicCache cache, CacheWriteSynchronizationMode syncMode, GridCacheOperation op, Object[] invokeArgs, boolean retval, boolean rawRetval, javax.cache.expiry.ExpiryPolicy expiryPlc, CacheEntryPredicate[] filter, UUID subjId, int taskNameHash, boolean skipStore, boolean keepBinary, int remapCnt, boolean waitTopFut)`
Constructor.

### Method Summary

Methods
`protected GridCacheVersion` `addAtomicFuture(AffinityTopologyVersion topVer)` Adds future prevents topology change before operation complete.
`IgniteUuid` `futureId()`
`void` `map()` Performs future mapping.
`protected abstract void` `map(AffinityTopologyVersion topVer, GridCacheVersion futVer)`
`protected abstract void` `mapOnTopology()` Maps future on ready topology.
`protected void` `mapSingle(UUID nodeId, GridNearAtomicAbstractUpdateRequest req)` Maps future to single node.
`void` `markNotTrackable()` Marks this future as non-trackable.
`abstract void` `onResult(UUID nodeId, GridNearAtomicUpdateResponse res, boolean nodeErr)` Response callback.
`protected void` `onSendError(GridNearAtomicAbstractUpdateRequest req, IgniteCheckedException e)`
`protected boolean` `storeFuture()`
`boolean` `trackable()`

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

`cancel, chain, chain, duration, endTime, error, get, get, get, get0, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, 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.processors.cache.GridCacheAtomicFuture

`completeFuture, version`

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheFuture

`onNodeLeft`

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

`cancel, chain, 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.

#### cctx

    protected final GridCacheContext cctx

Cache context.

#### cache

    protected final GridDhtAtomicCache cache

Cache.

#### syncMode

    protected final CacheWriteSynchronizationMode syncMode

Write synchronization mode.

#### op

    protected final GridCacheOperation op

Update operation.

#### invokeArgs

    protected final Object[] invokeArgs

Optional arguments for entry processor.

#### retval

    protected final boolean retval

Return value require flag.

#### rawRetval

    protected final boolean rawRetval

Raw return value flag.

#### expiryPlc

    protected final javax.cache.expiry.ExpiryPolicy expiryPlc

Expiry policy.

#### filter

    protected final CacheEntryPredicate[] filter

Optional filter.

#### subjId

    protected final UUID subjId

Subject ID.

#### taskNameHash

    protected final int taskNameHash

Task name hash.

#### skipStore

    protected final boolean skipStore

Skip store flag.

#### keepBinary

    protected final boolean keepBinary

Keep binary flag.

#### waitTopFut

    protected final boolean waitTopFut

Wait for topology future flag.

#### nearEnabled

    protected final boolean nearEnabled

Near cache flag.

#### mux

    protected final Object mux

Mutex to synchronize state updates.

#### topLocked

    protected boolean topLocked

Topology locked flag. Set if atomic update is performed inside a TX or explicit lock.

#### remapCnt

    protected int remapCnt

Remap count.

#### topVer

    protected AffinityTopologyVersion topVer

Current topology version.

#### updVer

    protected GridCacheVersion updVer

#### mapErrTopVer

    protected AffinityTopologyVersion mapErrTopVer

Topology version when got mapping error.

#### resCnt

    protected int resCnt

#### err

    protected CachePartialUpdateCheckedException err

Error.

#### futVer

    protected GridCacheVersion futVer

Future ID.

#### topCompleteFut

    protected GridFutureAdapter<Void> topCompleteFut

Completion future for a particular topology version.

#### opRes

    protected GridCacheReturn opRes

Operation result.

### Constructor Detail

#### GridNearAtomicAbstractUpdateFuture

    protected GridNearAtomicAbstractUpdateFuture(GridCacheContext cctx,
                                      GridDhtAtomicCache cache,
                                      CacheWriteSynchronizationMode syncMode,
                                      GridCacheOperation op,
                                      @Nullable
                                      Object[] invokeArgs,
                                      boolean retval,
                                      boolean rawRetval,
                                      @Nullable
                                      javax.cache.expiry.ExpiryPolicy expiryPlc,
                                      CacheEntryPredicate[] filter,
                                      UUID subjId,
                                      int taskNameHash,
                                      boolean skipStore,
                                      boolean keepBinary,
                                      int remapCnt,
                                      boolean waitTopFut)

Constructor.

Parameters:
  `cctx` - Cache context.
  `cache` - Cache.
  `syncMode` - Synchronization mode.
  `op` - Operation.
  `invokeArgs` - Invoke arguments.
  `retval` - Return value flag.
  `rawRetval` - Raw return value flag.
  `expiryPlc` - Expiry policy.
  `filter` - Filter.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash.
  `skipStore` - Skip store flag.
  `keepBinary` - Keep binary flag.
  `remapCnt` - Remap count.
  `waitTopFut` - Wait topology future flag.

### Method Detail

#### map

    public void map()

Performs future mapping.

#### map

    protected abstract void map(AffinityTopologyVersion topVer,
           GridCacheVersion futVer)

Parameters:
  `topVer` - Topology version.
  `futVer` - Future version

#### mapOnTopology

    protected abstract void mapOnTopology()

Maps future on ready topology.

#### futureId

    public IgniteUuid futureId()

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

#### trackable

    public boolean trackable()

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

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

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

#### storeFuture

    protected boolean storeFuture()

Returns:
  `True` future is stored by `GridCacheMvccManager.addAtomicFuture(org.apache.ignite.internal.processors.cache.version.GridCacheVersion, org.apache.ignite.internal.processors.cache.GridCacheAtomicFuture<?>)`.

#### mapSingle

    protected void mapSingle(UUID nodeId,
                 GridNearAtomicAbstractUpdateRequest req)

Maps future to single node.

Parameters:
  `nodeId` - Node ID.
  `req` - Request.

#### onResult

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

#### onSendError

    protected final void onSendError(GridNearAtomicAbstractUpdateRequest req,
                   IgniteCheckedException e)

Parameters:
  `req` - Request.
  `e` - Error.

#### addAtomicFuture

    protected final GridCacheVersion addAtomicFuture(AffinityTopologyVersion topVer)

Adds future prevents topology change before operation complete. Should be invoked before topology lock released.

Parameters:
  `topVer` - Topology version.
Returns:
  Future version in case future added.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017