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

## Class GridNearOptimisticTxPrepareFuture

- 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
        - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFutureAdapter
          - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture

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

    public class GridNearOptimisticTxPrepareFuture
    extends GridNearOptimisticTxPrepareFutureAdapter
    implements IgniteDiagnosticAware

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFutureAdapter

`GridNearOptimisticTxPrepareFutureAdapter.KeyLockFuture`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareFutureAdapter

`cctx, err, ERR_UPD, futId, log, logRef, msgLog, trackable, tx`

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addDiagnosticRequest(IgniteDiagnosticPrepareContext ctx)`
`boolean` `onDone(IgniteInternalTx t, Throwable err)` Callback to notify that future is finished.
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`boolean` `onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)`
`void` `onResult(UUID nodeId, GridNearTxPrepareResponse res)`
`protected void` `prepare0(boolean remap, boolean topLocked)` Initializes future.
`Set<IgniteTxKey>` `requestedKeys()`
`String` `toString()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFutureAdapter

`prepare, prepareOnTopology, topologyReadLock, topologyReadUnlock`

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareFutureAdapter

`futureId, markNotTrackable, trackable, tx, 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, 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`

### Constructor Detail

#### GridNearOptimisticTxPrepareFuture

    public GridNearOptimisticTxPrepareFuture(GridCacheSharedContext cctx,
                                             GridNearTxLocal tx)

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

### Method Detail

#### onOwnerChanged

    public boolean onOwnerChanged(GridCacheEntryEx entry,
                                  GridCacheMvccCandidate owner)

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

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Callback for when node left.

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

#### onResult

    public void onResult(UUID nodeId,
                         GridNearTxPrepareResponse res)

Specified by:
  `onResult` in class `GridNearTxPrepareFutureAdapter`
Parameters:
  `nodeId` - Sender.
  `res` - Result.

#### requestedKeys

    public Set<IgniteTxKey> requestedKeys()

Returns:
  Keys for which `MiniFuture` isn't completed.

#### onDone

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

#### prepare0

    protected void prepare0(boolean remap,
                            boolean topLocked)

Initializes future.

Specified by:
  `prepare0` in class `GridNearOptimisticTxPrepareFutureAdapter`
Parameters:
  `remap` - Remap flag.
  `topLocked` - `True` if thread already acquired lock preventing topology change.

#### addDiagnosticRequest

    public void addDiagnosticRequest(IgniteDiagnosticPrepareContext ctx)

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

#### toString

    public String toString()

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

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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