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

## Class GridNearOptimisticTxPrepareFutureAdapter

- 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

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

Direct Known Subclasses:
  GridNearOptimisticSerializableTxPrepareFuture, GridNearOptimisticTxPrepareFuture

    public abstract class GridNearOptimisticTxPrepareFutureAdapter
    extends GridNearTxPrepareFutureAdapter

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`protected static class` `GridNearOptimisticTxPrepareFutureAdapter.KeyLockFuture` Keys lock future.

### 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
`GridNearOptimisticTxPrepareFutureAdapter(GridCacheSharedContext cctx, GridNearTxLocal tx)`

### Method Summary

Methods
`void` `prepare()` Prepares transaction.
`protected abstract void` `prepare0(boolean remap, boolean topLocked)`
`protected void` `prepareOnTopology(boolean remap, Runnable c)`
`protected GridDhtTopologyFuture` `topologyReadLock()` Acquires topology read lock.
`protected void` `topologyReadUnlock()` Releases topology read lock.

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

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

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

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

### 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, 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.processors.cache.GridCacheMvccFuture

`onOwnerChanged`

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

`onNodeLeft`

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

#### GridNearOptimisticTxPrepareFutureAdapter

    public GridNearOptimisticTxPrepareFutureAdapter(GridCacheSharedContext cctx,
                                            GridNearTxLocal tx)

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

### Method Detail

#### prepare

    public final void prepare()

Prepares transaction.

Specified by:
  `prepare` in class `GridNearTxPrepareFutureAdapter`

#### topologyReadLock

    protected final GridDhtTopologyFuture topologyReadLock()

Acquires topology read lock.

Returns:
  Topology ready future.

#### topologyReadUnlock

    protected final void topologyReadUnlock()

Releases topology read lock.

#### prepareOnTopology

    protected final void prepareOnTopology(boolean remap,
                         @Nullable
                         Runnable c)

Parameters:
  `remap` - Remap flag.
  `c` - Optional closure to run after map.

#### prepare0

    protected abstract void prepare0(boolean remap,
                boolean topLocked)

Parameters:
  `remap` - Remap flag.
  `topLocked` - `True` if thread already acquired lock preventing topology change.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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