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

## Class GridDhtTxPrepareFuture

- java.lang.Object
- - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
  - - org.apache.ignite.internal.util.future.GridCompoundFuture<T,R>
    - - org.apache.ignite.internal.processors.cache.GridCacheCompoundFuture<IgniteInternalTx,GridNearTxPrepareResponse>
      - - org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture

All Implemented Interfaces:
  Serializable, IgniteDiagnosticAware, IgniteInternalFuture<GridNearTxPrepareResponse>, GridCacheFuture<GridNearTxPrepareResponse>, GridCacheVersionedFuture<GridNearTxPrepareResponse>, IgniteInClosure<IgniteInternalFuture<IgniteInternalTx>>

    public final class GridDhtTxPrepareFuture
    extends GridCacheCompoundFuture<IgniteInternalTx,GridNearTxPrepareResponse>
    implements GridCacheVersionedFuture<GridNearTxPrepareResponse>, IgniteDiagnosticAware

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridDhtTxPrepareFuture(GridCacheSharedContext cctx, GridDhtTxLocalAdapter tx, long timeout, int nearMiniId, Map<IgniteTxKey,GridCacheVersion> dhtVerMap, boolean last, boolean retVal)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addDiagnosticRequest(IgniteDiagnosticPrepareContext req)`
`void` `complete()` Completes this future.
`IgniteUuid` `futureId()`
`IgniteLogger` `logger()`
`void` `markNotTrackable()` Marks this future as non-trackable.
`boolean` `onDone(GridNearTxPrepareResponse res0, Throwable err)` Callback to notify that future is finished.
`void` `onError(Throwable t)`
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`boolean` `onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)`
`void` `onResult(UUID nodeId, GridDhtTxPrepareResponse res)`
`void` `prepare(GridNearTxPrepareRequest req)` Initializes future.
`String` `toString()`
`boolean` `trackable()`
`GridDhtTxLocalAdapter` `tx()`
`GridCacheVersion` `version()`

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

`duration, onDone, startTime`

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

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

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

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

### Constructor Detail

#### GridDhtTxPrepareFuture

    public GridDhtTxPrepareFuture(GridCacheSharedContext cctx,
                                  GridDhtTxLocalAdapter tx,
                                  long timeout,
                                  int nearMiniId,
                                  Map<IgniteTxKey,GridCacheVersion> dhtVerMap,
                                  boolean last,
                                  boolean retVal)

Parameters:
  `cctx` - Context.
  `tx` - Transaction.
  `timeout` - Timeout.
  `nearMiniId` - Near mini future id.
  `dhtVerMap` - DHT versions map.
  `last` - `True` if this is last prepare operation for node.
  `retVal` - Return value flag.

### Method Detail

#### logger

    @Nullable
    public IgniteLogger logger()

Overrides:
  `logger` in class `GridFutureAdapter<GridNearTxPrepareResponse>`
Returns:
  Logger instance.

#### futureId

    public IgniteUuid futureId()

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

#### version

    public GridCacheVersion version()

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

#### onOwnerChanged

    public boolean onOwnerChanged(GridCacheEntryEx entry,
                                  GridCacheMvccCandidate owner)

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

#### trackable

    public boolean trackable()

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

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

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

#### tx

    public GridDhtTxLocalAdapter tx()

Returns:
  Transaction.

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Callback for when node left.

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

#### onError

    public void onError(Throwable t)

Parameters:
  `t` - Error.

#### onResult

    public void onResult(UUID nodeId,
                         GridDhtTxPrepareResponse res)

Parameters:
  `nodeId` - Sender.
  `res` - Result.

#### onDone

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

#### complete

    public void complete()

Completes this future.

#### prepare

    public void prepare(GridNearTxPrepareRequest req)

Initializes future.

Parameters:
  `req` - Prepare request.

#### addDiagnosticRequest

    public void addDiagnosticRequest(IgniteDiagnosticPrepareContext req)

Specified by:
  `addDiagnosticRequest` in interface `IgniteDiagnosticAware`
Parameters:
  `req` - Context.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCompoundFuture<IgniteInternalTx,GridNearTxPrepareResponse>`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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