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

## Class GridNearOptimisticTxPrepareFuture

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

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

    public class GridNearOptimisticTxPrepareFuture
    extends GridNearOptimisticTxPrepareFutureAdapter

See Also:
  Serialized Form

### Nested Class Summary

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

`GridNearOptimisticTxPrepareFutureAdapter.KeyLockFuture`

### 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, futId, log, logRef, trackable, tx, txMapping`

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

`futs`

### Constructor Summary

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

### Method Summary

Methods
`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.
`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

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

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

`add, addAll, addAll, cancel, futures, hasPending, ignoreChildFailures, initialized, markInitialized, pending, reducer, reducer`

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

`chain, duration, endTime, error, get, get, get, get0, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, 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, duration, error, get, get, get, getUninterruptibly, isCancelled, isDone, listen, result, startTime`

### Constructor Detail

#### GridNearOptimisticTxPrepareFuture

    public GridNearOptimisticTxPrepareFuture(GridCacheSharedContext cctx,
                                     GridNearTxLocal tx)

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

### Method Detail

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

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

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

#### toString

    public String toString()

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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015