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

## Class GridDhtTxAbstractEnlistFuture<T>

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

All Implemented Interfaces:
  IgniteInternalFuture<T>, DhtLockFuture<T>, GridCacheFuture<T>

Direct Known Subclasses:
  GridDhtTxEnlistFuture, GridDhtTxQueryAbstractEnlistFuture

    public abstract class GridDhtTxAbstractEnlistFuture<T>
    extends GridCacheFutureAdapter<T>
    implements DhtLockFuture<T>

Abstract future processing transaction enlisting and locking.

### Nested Class Summary

Nested Classes
`protected class` `GridDhtTxAbstractEnlistFuture.LockTimeoutObject` Lock request timeout object.

### Field Summary

Fields
`protected GridCacheContext<?,?>` `cctx` Cache registry.
`protected IgniteUuid` `deploymentLdrId` Deployment class loader id which will be used for deserialization of entries on a distributed task.
`protected IgniteUuid` `futId` Future ID.
`protected boolean` `hasNearNodeUpdates` There are keys belonging to backup partitions on near node.
`protected boolean` `keepBinary` Keep binary flag.
`protected GridCacheVersion` `lockVer` Lock version.
`protected IgniteLogger` `log` Logger.
`protected MvccSnapshot` `mvccSnapshot`
`protected IgniteUuid` `nearFutId` Future ID.
`protected GridCacheVersion` `nearLockVer` Near lock version.
`protected int` `nearMiniId` Future ID.
`protected UUID` `nearNodeId` Near node ID.
`protected Set<UUID>` `newDhtNodes` New DHT nodes.
`protected boolean` `skipNearNodeUpdates` Do not send DHT requests to near node.
`protected long` `threadId` Thread.
`protected long` `timeout` Lock timeout.
`protected GridDhtTxAbstractEnlistFuture.LockTimeoutObject` `timeoutObj` Timeout object.
`protected GridDhtTxLocalAdapter` `tx` Transaction.

### Constructor Summary

Constructors
`protected` `GridDhtTxAbstractEnlistFuture(UUID nearNodeId, GridCacheVersion nearLockVer, MvccSnapshot mvccSnapshot, long threadId, IgniteUuid nearFutId, int nearMiniId, GridDhtTxLocalAdapter tx, long timeout, GridCacheContext<?,?> cctx, @Nullable CacheEntryPredicate filter, boolean keepBinary)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected void` `clearLockFuture()` Clears lock future.
`protected abstract UpdateSourceIterator<?>` `createIterator()` Gets source to be updated iterator.
`IgniteUuid` `futureId()`
`void` `init()`
`void` `markNotTrackable()` Marks this future as non-trackable.
`boolean` `needResult()` Gets need previous value flag.
`boolean` `onDone(T res, @Nullable Throwable err)` Callback to notify that future is finished.
`protected abstract void` `onEntryProcessed(KeyCacheObject key, GridCacheUpdateTxResult res)` Entry processed callback.
`void` `onError(Throwable error)`
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`void` `onResult(UUID nodeId, GridDhtTxQueryEnlistResponse res)` Callback on backup response.
`protected abstract T` `result0()` Gets query result.
`protected @NotNull IgniteTxTimeoutCheckedException` `timeoutException()`
`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, chainCompose, chainCompose, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, onDone, onDone, reset, result, toString`

### 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, chain, chainCompose, chainCompose, error, get, get, get, getUninterruptibly, isCancelled, isDone, listen, result`

### Field Detail

#### futId

    protected final IgniteUuid futId

Future ID.

#### cctx

    @GridToStringExclude
    protected final GridCacheContext<?,?> cctx

Cache registry.

#### log

    @GridToStringExclude
    protected final IgniteLogger log

Logger.

#### threadId

    protected final long threadId

Thread.

#### nearFutId

    protected final IgniteUuid nearFutId

Future ID.

#### nearMiniId

    protected final int nearMiniId

Future ID.

#### tx

    protected final GridDhtTxLocalAdapter tx

Transaction.

#### lockVer

    protected final GridCacheVersion lockVer

Lock version.

#### mvccSnapshot

    protected final MvccSnapshot mvccSnapshot

#### newDhtNodes

    protected Set<UUID> newDhtNodes

New DHT nodes.

#### nearNodeId

    protected final UUID nearNodeId

Near node ID.

#### nearLockVer

    protected final GridCacheVersion nearLockVer

Near lock version.

#### keepBinary

    protected boolean keepBinary

Keep binary flag.

#### timeoutObj

    @GridToStringExclude
    protected GridDhtTxAbstractEnlistFuture.LockTimeoutObject timeoutObj

Timeout object.

#### timeout

    protected final long timeout

Lock timeout.

#### skipNearNodeUpdates

    protected boolean skipNearNodeUpdates

Do not send DHT requests to near node.

#### hasNearNodeUpdates

    protected boolean hasNearNodeUpdates

There are keys belonging to backup partitions on near node.

#### deploymentLdrId

    @GridToStringExclude
    protected final IgniteUuid deploymentLdrId

Deployment class loader id which will be used for deserialization of entries on a distributed task.

### Constructor Detail

#### GridDhtTxAbstractEnlistFuture

    protected GridDhtTxAbstractEnlistFuture(UUID nearNodeId,
                                            GridCacheVersion nearLockVer,
                                            MvccSnapshot mvccSnapshot,
                                            long threadId,
                                            IgniteUuid nearFutId,
                                            int nearMiniId,
                                            GridDhtTxLocalAdapter tx,
                                            long timeout,
                                            GridCacheContext<?,?> cctx,
                                            @Nullable
                                            @Nullable CacheEntryPredicate filter,
                                            boolean keepBinary)

Parameters:
  `nearNodeId` - Near node ID.
  `nearLockVer` - Near lock version.
  `mvccSnapshot` - Mvcc snapshot.
  `threadId` - Thread ID.
  `nearFutId` - Near future id.
  `nearMiniId` - Near mini future id.
  `tx` - Transaction.
  `timeout` - Lock acquisition timeout.
  `cctx` - Cache context.
  `filter` - Filter.
  `keepBinary` - Keep binary flag.

### Method Detail

#### createIterator

    protected abstract UpdateSourceIterator<?> createIterator()
                                                       throws IgniteCheckedException

Gets source to be updated iterator.

Returns:
  iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### result0

    protected abstract T result0()

Gets query result.

Returns:
  Query result.

#### needResult

    public boolean needResult()

Gets need previous value flag.

Returns:
  `True` if previous value is required.

#### onEntryProcessed

    protected abstract void onEntryProcessed(KeyCacheObject key,
                                             GridCacheUpdateTxResult res)

Entry processed callback.

Parameters:
  `key` - Entry key.
  `res` - Update result.

#### init

    public void init()

#### clearLockFuture

    protected void clearLockFuture()

Clears lock future.

#### onResult

    public void onResult(UUID nodeId,
                         GridDhtTxQueryEnlistResponse res)

Callback on backup response.

Parameters:
  `nodeId` - Backup node.
  `res` - Response.

#### trackable

    public boolean trackable()

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

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

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

#### futureId

    public IgniteUuid futureId()

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

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Callback for when node left.

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

#### onDone

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

#### onError

    public void onError(Throwable error)

Specified by:
  `onError` in interface `DhtLockFuture<T>`
Parameters:
  `error` - Error.

#### timeoutException

    @NotNull
    protected @NotNull IgniteTxTimeoutCheckedException timeoutException()

Returns:
  Timeout exception.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023