org.apache.ignite.internal.processors.cache.distributed.near

## Class GridNearTxSelectForUpdateFuture

- java.lang.Object
- - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
  - - org.apache.ignite.internal.util.future.GridCompoundFuture<T,T>
    - - org.apache.ignite.internal.util.future.GridCompoundIdentityFuture<T>
      - - org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture<Long>
        - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxSelectForUpdateFuture

All Implemented Interfaces:
  Serializable, IgniteInternalFuture<Long>, GridCacheFuture<Long>, GridCacheVersionedFuture<Long>, IgniteInClosure<IgniteInternalFuture<Long>>

    public class GridNearTxSelectForUpdateFuture
    extends GridCacheCompoundIdentityFuture<Long>
    implements GridCacheVersionedFuture<Long>

A future tracking requests for remote nodes transaction enlisting and locking of entries produced with complex DML queries requiring reduce step.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridNearTxSelectForUpdateFuture(GridCacheContext<?,?> cctx, GridNearTxLocal tx, long timeout)`

### Method Summary

All Methods Instance Methods Concrete Methods
`GridCacheContext<?,?>` `cache()`
`IgniteUuid` `futureId()`
`void` `init(AffinityTopologyVersion topVer, Collection<ClusterNode> nodes)` Initialize this future for distributed execution.
`void` `initLocal()` Initialize this future for local execution.
`protected void` `logDebug(IgniteLogger log, String msg)`
`protected void` `logError(IgniteLogger log, String msg, Throwable e)`
`void` `markNotTrackable()` Marks this future as non-trackable.
`boolean` `onDone(Long res, Throwable err, boolean cancelled)`
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`boolean` `onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)`
`void` `onResult(UUID nodeId, Long cnt, boolean removeMapping, Throwable err)` Process result of query execution on given
`protected boolean` `processFailure(Throwable err, IgniteInternalFuture<Long> fut)` Processes error thrown by some of the inner futures.
`String` `toString()`
`boolean` `trackable()`
`GridCacheVersion` `version()`

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

`duration, startTime`

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

`add, apply, cancel, clear, future, futures, futuresCountNoLock, hasFutures, hasPending, ignoreFailure, initialized, markInitialized`

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

`chain, chain, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, 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`

### Constructor Detail

#### GridNearTxSelectForUpdateFuture

    public GridNearTxSelectForUpdateFuture(GridCacheContext<?,?> cctx,
                                           GridNearTxLocal tx,
                                           long timeout)

Parameters:
  `cctx` - Cache context.
  `tx` - Transaction.
  `timeout` - Timeout.

### Method Detail

#### cache

    public GridCacheContext<?,?> cache()

Returns:
  Cache context.

#### onResult

    public void onResult(UUID nodeId,
                         Long cnt,
                         boolean removeMapping,
                         @Nullable
                         Throwable err)

Process result of query execution on given

Parameters:
  `nodeId` - Node id.
  `cnt` - Total rows counter on given node.
  `removeMapping` - Whether transaction mapping should be removed for node.
  `err` - Error.

#### processFailure

    protected boolean processFailure(Throwable err,
                                     IgniteInternalFuture<Long> fut)

Processes error thrown by some of the inner futures.

Overrides:
  `processFailure` in class `GridCompoundFuture<Long,Long>`
Parameters:
  `err` - Thrown exception.
  `fut` - Failed future.
Returns:
  `True` if this error should be ignored.

#### onDone

    public boolean onDone(@Nullable
                          Long res,
                          @Nullable
                          Throwable err,
                          boolean cancelled)

Overrides:
  `onDone` in class `GridCacheCompoundIdentityFuture<Long>`
Parameters:
  `res` - Result.
  `err` - Error.
  `cancelled` - `True` if future is being cancelled.
Returns:
  `True` if result was set by this call.

#### version

    public GridCacheVersion version()

Specified by:
  `version` in interface `GridCacheVersionedFuture<Long>`
Returns:
  Future version.

#### onOwnerChanged

    public boolean onOwnerChanged(GridCacheEntryEx entry,
                                  GridCacheMvccCandidate owner)

Specified by:
  `onOwnerChanged` in interface `GridCacheVersionedFuture<Long>`
Parameters:
  `entry` - Entry which received new owner.
  `owner` - Owner.
Returns:
  `True` if future cares about this entry.

#### futureId

    public IgniteUuid futureId()

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

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Callback for when node left.

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

#### trackable

    public boolean trackable()

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

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

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

#### logError

    protected void logError(IgniteLogger log,
                            String msg,
                            Throwable e)

Overrides:
  `logError` in class `GridCompoundFuture<Long,Long>`
Parameters:
  `log` - IgniteLogger.
  `msg` - ShortMessage.
  `e` - Exception.

#### logDebug

    protected void logDebug(IgniteLogger log,
                            String msg)

Overrides:
  `logDebug` in class `GridCompoundFuture<Long,Long>`
Parameters:
  `log` - IgniteLogger.
  `msg` - ShortMessage.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCompoundIdentityFuture<Long>`

#### init

    public void init(AffinityTopologyVersion topVer,
                     Collection<ClusterNode> nodes)

Initialize this future for distributed execution.

Parameters:
  `topVer` - Topology version.
  `nodes` - Nodes to run query on.

#### initLocal

    public void initLocal()

Initialize this future for local execution.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.0
Release Date | : November 30 2018