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

## Class GridDhtAtomicAbstractUpdateFuture

- java.lang.Object
- - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
  - - org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter<Void>
    - - org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateFuture

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

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

DHT atomic cache backup update future.

### Field Summary

Fields
`protected GridCacheContext` `cctx` Cache context.
`protected long` `futId` Future version.
`protected static IgniteLogger` `log` Logger.
`protected Map<UUID,GridDhtAtomicAbstractUpdateRequest>` `mappings` Mappings.
`protected static IgniteLogger` `msgLog` Logger.
`protected GridCacheVersion` `writeVer` Write version.

### Constructor Summary

Constructors
`protected` `GridDhtAtomicAbstractUpdateFuture(GridCacheContext cctx, GridCacheVersion writeVer, GridNearAtomicAbstractUpdateRequest updateReq)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`void` `addContinuousQueryClosure(CI1<Boolean> clsr, boolean sync)`
`protected abstract void` `addDhtKey(KeyCacheObject key, List<ClusterNode> dhtNodes)`
`protected abstract void` `addNearKey(KeyCacheObject key, GridDhtCacheEntry.ReaderId[] readers)`
`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(UUID nodeId, long futId, 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.
`protected abstract boolean` `sendAllToDht()`
`String` `toString()`
`boolean` `trackable()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter

`duration, onDone, startTime`

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

`cancel, chain, chain, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, onDone, onDone, reset, result`

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

`duration, startTime`

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

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

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

#### futId

    @GridToStringInclude
    protected final long futId

Future version.

#### mappings

    @GridToStringExclude
    protected Map<UUID,GridDhtAtomicAbstractUpdateRequest> mappings

Mappings.

### Constructor Detail

#### GridDhtAtomicAbstractUpdateFuture

    protected GridDhtAtomicAbstractUpdateFuture(GridCacheContext cctx,
                                                GridCacheVersion writeVer,
                                                GridNearAtomicAbstractUpdateRequest updateReq)

Parameters:
  `cctx` - Cache context.
  `writeVer` - Write version.
  `updateReq` - Update request.

### Method Detail

#### sendAllToDht

    protected abstract boolean sendAllToDht()

Returns:
  `True` if all updates are sent to DHT.

#### 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,
                                                boolean sync)

Parameters:
  `clsr` - Continuous query closure.
  `sync` - Synchronous continuous query flag.

#### addDhtKey

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

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

#### addNearKey

    protected abstract void addNearKey(KeyCacheObject key,
                                       GridDhtCacheEntry.ReaderId[] readers)

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

#### futureId

    public final IgniteUuid futureId()

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

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

#### createRequest

    protected abstract GridDhtAtomicAbstractUpdateRequest createRequest(UUID nodeId,
                                                                        long futId,
                                                                        GridCacheVersion writeVer,
                                                                        CacheWriteSynchronizationMode syncMode,
                                                                        @NotNull
                                                                        AffinityTopologyVersion topVer,
                                                                        long ttl,
                                                                        long conflictExpireTime,
                                                                        @Nullable
                                                                        GridCacheVersion conflictVer)

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

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

#### toString

    public String toString()

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

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018