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

## Class GridNearTxPrepareFutureAdapter

- 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<GridNearTxPrepareResponse,IgniteInternalTx>
      - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareFutureAdapter

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

Direct Known Subclasses:
  GridNearOptimisticTxPrepareFutureAdapter, GridNearPessimisticTxPrepareFuture

    public abstract class GridNearTxPrepareFutureAdapter
    extends GridCacheCompoundFuture<GridNearTxPrepareResponse,IgniteInternalTx>
    implements GridCacheVersionedFuture<IgniteInternalTx>

Common code for tx prepare in optimistic and pessimistic modes.

See Also:
  Serialized Form

### Field Summary

Fields
`protected GridCacheSharedContext<?,?>` `cctx` Context.
`protected Throwable` `err` Error.
`protected static AtomicReferenceFieldUpdater<GridNearTxPrepareFutureAdapter,Throwable>` `ERR_UPD` Error updater.
`protected IgniteUuid` `futId` Future ID.
`protected static IgniteLogger` `log` Logger.
`protected static AtomicReference<IgniteLogger>` `logRef` Logger reference.
`protected static IgniteLogger` `msgLog` Logger.
`protected boolean` `trackable` Trackable flag.
`protected GridNearTxLocal` `tx` Transaction.

### Constructor Summary

Constructors
Constructor and Description
`GridNearTxPrepareFutureAdapter(GridCacheSharedContext cctx, GridNearTxLocal tx)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`IgniteUuid` `futureId()`
`void` `markNotTrackable()` Marks this future as non-trackable.
`abstract void` `onResult(UUID nodeId, GridNearTxPrepareResponse res)`
`abstract void` `prepare()` Prepares transaction.
`boolean` `trackable()`
`IgniteInternalTx` `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, toString`

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

`onOwnerChanged`

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

`duration, onNodeLeft, startTime`

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

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

### Field Detail

#### logRef

    protected static final AtomicReference<IgniteLogger> logRef

Logger reference.

#### ERR_UPD

    protected static final AtomicReferenceFieldUpdater<GridNearTxPrepareFutureAdapter,Throwable> ERR_UPD

Error updater.

#### log

    protected static IgniteLogger log

Logger.

#### msgLog

    protected static IgniteLogger msgLog

Logger.

#### cctx

    protected GridCacheSharedContext<?,?> cctx

Context.

#### futId

    @GridToStringInclude
    protected IgniteUuid futId

Future ID.

#### tx

    @GridToStringInclude
    protected GridNearTxLocal tx

Transaction.

#### err

    @GridToStringExclude
    protected volatile Throwable err

Error.

#### trackable

    protected boolean trackable

Trackable flag.

### Constructor Detail

#### GridNearTxPrepareFutureAdapter

    public GridNearTxPrepareFutureAdapter(GridCacheSharedContext cctx,
                                          GridNearTxLocal tx)

Parameters:
  `cctx` - Context.
  `tx` - Transaction.

### Method Detail

#### futureId

    public IgniteUuid futureId()

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

#### version

    public GridCacheVersion version()

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

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

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

#### trackable

    public boolean trackable()

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

#### tx

    public IgniteInternalTx tx()

Returns:
  Transaction.

#### prepare

    public abstract void prepare()

Prepares transaction.

#### onResult

    public abstract void onResult(UUID nodeId,
                                  GridNearTxPrepareResponse res)

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

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018