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

## Class GridNearOptimisticTxPrepareFutureAdapter

- 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<Object,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>, GridCacheVersionedFuture<IgniteInternalTx>, IgniteInClosure<IgniteInternalFuture<Object>>

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.

### Field Summary

Fields
`protected GridNearOptimisticTxPrepareFutureAdapter.KeyLockFuture` `keyLockFut`
`protected Span` `span` Tracing span.

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

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected boolean` `errorOrTimeoutOnTopologyVersion(IgniteCheckedException e, boolean timedOut)`
`void` `onNearTxLocalTimeout()` Called when related `GridNearTxLocal` is completed asynchronously on timeout,
`void` `prepare()` Prepares transaction.
`protected abstract void` `prepare0(boolean remap, boolean topLocked)`
`protected void` `prepareOnTopology(boolean remap, @Nullable 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

`futureId, markNotTrackable, onResult, 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, compoundsLockedExclusively, compoundsReadLock, compoundsReadUnlock, 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

#### span

    protected Span span

Tracing span.

#### keyLockFut

    @GridToStringExclude
    protected GridNearOptimisticTxPrepareFutureAdapter.KeyLockFuture keyLockFut

### Constructor Detail

#### GridNearOptimisticTxPrepareFutureAdapter

    protected GridNearOptimisticTxPrepareFutureAdapter(GridCacheSharedContext cctx,
                                                       GridNearTxLocal tx)

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

### Method Detail

#### onNearTxLocalTimeout

    public final void onNearTxLocalTimeout()

Called when related `GridNearTxLocal` is completed asynchronously on timeout,

Specified by:
  `onNearTxLocalTimeout` in class `GridNearTxPrepareFutureAdapter`

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

#### errorOrTimeoutOnTopologyVersion

    protected boolean errorOrTimeoutOnTopologyVersion(IgniteCheckedException e,
                                                      boolean timedOut)

Parameters:
  `e` - Exception.
  `timedOut` - `True` if timed out.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022