org.apache.ignite.internal.processors.cache.transactions

## Class IgniteTxRemoteStateAdapter

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.transactions.IgniteTxRemoteStateAdapter

All Implemented Interfaces:
  IgniteTxRemoteState, IgniteTxState

Direct Known Subclasses:
  IgniteTxRemoteSingleStateImpl, IgniteTxRemoteStateImpl

    public abstract class IgniteTxRemoteStateAdapter
    extends Object
    implements IgniteTxRemoteState

### Field Summary

Fields
`protected boolean` `mvccEnabled`

### Constructor Summary

Constructors
Constructor and Description
`IgniteTxRemoteStateAdapter()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addActiveCache(GridCacheContext cctx, boolean recovery, IgniteTxAdapter tx)`
`void` `awaitLastFuture(GridCacheSharedContext cctx)`
`@Nullable GridIntList` `cacheIds()` Gets caches ids affected with current tx.
`@Nullable Integer` `firstCacheId()`
`boolean` `hasInterceptor(GridCacheSharedContext cctx)`
`boolean` `implicitSingle()`
`boolean` `mvccEnabled()`
`void` `onTxEnd(GridCacheSharedContext cctx, IgniteInternalTx tx, boolean commit)`
`@Nullable GridCacheContext` `singleCacheContext(GridCacheSharedContext cctx)`
`boolean` `storeWriteThrough(GridCacheSharedContext cctx)`
`CacheWriteSynchronizationMode` `syncMode(GridCacheSharedContext cctx)`
`GridDhtTopologyFuture` `topologyReadLock(GridCacheSharedContext cctx, GridFutureAdapter<?> fut)`
`void` `topologyReadUnlock(GridCacheSharedContext cctx)`
`boolean` `useMvccCaching(int cacheId)`
`IgniteCheckedException` `validateTopology(GridCacheSharedContext cctx, boolean read, GridDhtTopologyFuture topFut)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

`addWriteEntry, clearEntry, invalidPartition`

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

`allEntries, empty, entry, hasWriteKey, readEntries, readMap, readSet, singleWrite, stores, unwindEvicts, writeEntries, writeMap, writeSet`

### Field Detail

#### mvccEnabled

    protected boolean mvccEnabled

### Constructor Detail

#### IgniteTxRemoteStateAdapter

    public IgniteTxRemoteStateAdapter()

### Method Detail

#### implicitSingle

    public boolean implicitSingle()

Specified by:
  `implicitSingle` in interface `IgniteTxState`
Returns:
  Flag indicating whether transaction is implicit with only one key.

#### firstCacheId

    @Nullable
    public @Nullable Integer firstCacheId()

Specified by:
  `firstCacheId` in interface `IgniteTxState`
Returns:
  First tx cache id.

#### cacheIds

    @Nullable
    public @Nullable GridIntList cacheIds()

Gets caches ids affected with current tx.

Specified by:
  `cacheIds` in interface `IgniteTxState`
Returns:
  tx cache ids.

#### awaitLastFuture

    public void awaitLastFuture(GridCacheSharedContext cctx)

Specified by:
  `awaitLastFuture` in interface `IgniteTxState`
Parameters:
  `cctx` - Awaits for previous async operations on active caches to be completed.

#### validateTopology

    public IgniteCheckedException validateTopology(GridCacheSharedContext cctx,
                                                   boolean read,
                                                   GridDhtTopologyFuture topFut)

Specified by:
  `validateTopology` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
  `read` - `True` if validating for a read operation, `false` for write.
  `topFut` - Topology future.
Returns:
  Error if validation failed.

#### syncMode

    public CacheWriteSynchronizationMode syncMode(GridCacheSharedContext cctx)

Specified by:
  `syncMode` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
Returns:
  Write synchronization mode.

#### addActiveCache

    public void addActiveCache(GridCacheContext cctx,
                               boolean recovery,
                               IgniteTxAdapter tx)
                        throws IgniteCheckedException

Specified by:
  `addActiveCache` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
  `tx` - Transaction.
Throws:
  `IgniteCheckedException` - If cache check failed.

#### topologyReadLock

    public GridDhtTopologyFuture topologyReadLock(GridCacheSharedContext cctx,
                                                  GridFutureAdapter<?> fut)

Specified by:
  `topologyReadLock` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
  `fut` - Future to finish with error if some cache is stopping.
Returns:
  Topology future.

#### topologyReadUnlock

    public void topologyReadUnlock(GridCacheSharedContext cctx)

Specified by:
  `topologyReadUnlock` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.

#### storeWriteThrough

    public boolean storeWriteThrough(GridCacheSharedContext cctx)

Specified by:
  `storeWriteThrough` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
Returns:
  `True` if transaction is allowed to use store and transactions spans one or more caches with store enabled.

#### hasInterceptor

    public boolean hasInterceptor(GridCacheSharedContext cctx)

Specified by:
  `hasInterceptor` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
Returns:
  `True` if transaction spans one or more caches with configured interceptor.

#### singleCacheContext

    @Nullable
    public @Nullable GridCacheContext singleCacheContext(GridCacheSharedContext cctx)

Specified by:
  `singleCacheContext` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
Returns:
  cctx Non-null cache context if tx has only one active cache.

#### onTxEnd

    public void onTxEnd(GridCacheSharedContext cctx,
                        IgniteInternalTx tx,
                        boolean commit)

Specified by:
  `onTxEnd` in interface `IgniteTxState`
Parameters:
  `cctx` - Context.
  `tx` - Transaction.
  `commit` - Commit flag.

#### mvccEnabled

    public boolean mvccEnabled()

Specified by:
  `mvccEnabled` in interface `IgniteTxState`
Returns:
  `True` if MVCC mode is enabled for transaction.

#### useMvccCaching

    public boolean useMvccCaching(int cacheId)

Specified by:
  `useMvccCaching` in interface `IgniteTxState`
Parameters:
  `cacheId` - Cache id.
Returns:
  `True` if it is need to store in the heap updates made by the current TX for the given cache. These updates will be used for CQ and DR. See `MvccCachingManager`.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021