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

## Class GridNearPessimisticTxPrepareFuture

- java.lang.Object
- - java.util.concurrent.locks.AbstractOwnableSynchronizer
  - - java.util.concurrent.locks.AbstractQueuedSynchronizer
    - - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
      - - org.apache.ignite.internal.util.future.GridCompoundFuture<GridNearTxPrepareResponse,IgniteInternalTx>
        - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareFutureAdapter
          - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearPessimisticTxPrepareFuture

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

    public class GridNearPessimisticTxPrepareFuture
    extends GridNearTxPrepareFutureAdapter

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`AbstractQueuedSynchronizer.ConditionObject`

### 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, txMapping`

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

`sync`

### Constructor Summary

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

### Method Summary

Methods
`protected boolean` `ignoreFailure(Throwable err)` Checks if this compound future should ignore this particular exception.
`boolean` `onDone(IgniteInternalTx res, 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)`
`void` `prepare()` Prepares transaction.
`String` `toString()`

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

`checkOnePhase, futureId, markNotTrackable, onPrepareResponse, trackable, tx, version`

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

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

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

`chain, chain, duration, endTime, error, get, get, get, get0, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, onDone, onDone, result, startTime, tryAcquireShared, tryReleaseShared`

### Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryRelease`

### Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer

`getExclusiveOwnerThread, setExclusiveOwnerThread`

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

### Constructor Detail

#### GridNearPessimisticTxPrepareFuture

    public GridNearPessimisticTxPrepareFuture(GridCacheSharedContext cctx,
                                      GridNearTxLocal tx)

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

### Method Detail

#### ignoreFailure

    protected boolean ignoreFailure(Throwable err)

Checks if this compound future should ignore this particular exception.

Overrides:
  `ignoreFailure` in class `GridCompoundFuture<GridNearTxPrepareResponse,IgniteInternalTx>`
Parameters:
  `err` - Exception to check.
Returns:
  `True` if this error should be ignored.

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Callback for when node left.

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.

#### prepare

    public void prepare()

Prepares transaction.

Specified by:
  `prepare` in class `GridNearTxPrepareFutureAdapter`

#### onOwnerChanged

    public boolean onOwnerChanged(GridCacheEntryEx entry,
                         GridCacheMvccCandidate owner)

Parameters:
  `entry` - Entry which received new owner.
  `owner` - Owner.
Returns:
  `True` if future cares about this entry.

#### onDone

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

#### toString

    public String toString()

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

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017