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

## Interface IgniteTxState

All Known Subinterfaces:
  IgniteTxLocalState, IgniteTxRemoteState

All Known Implementing Classes:
  IgniteTxImplicitSingleStateImpl, IgniteTxLocalStateAdapter, IgniteTxRemoteSingleStateImpl, IgniteTxRemoteStateAdapter, IgniteTxRemoteStateImpl, IgniteTxStateImpl

    public interface IgniteTxState

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addActiveCache(GridCacheContext cacheCtx, boolean recovery, IgniteTxLocalAdapter tx)`
`Collection<IgniteTxEntry>` `allEntries()`
`void` `awaitLastFuture(GridCacheSharedContext cctx)`
`boolean` `empty()`
`IgniteTxEntry` `entry(IgniteTxKey key)`
`Integer` `firstCacheId()`
`boolean` `hasInterceptor(GridCacheSharedContext cctx)`
`boolean` `hasWriteKey(IgniteTxKey key)`
`boolean` `implicitSingle()`
`void` `onTxEnd(GridCacheSharedContext cctx, IgniteInternalTx tx, boolean commit)`
`Collection<IgniteTxEntry>` `readEntries()`
`Map<IgniteTxKey,IgniteTxEntry>` `readMap()`
`Set<IgniteTxKey>` `readSet()`
`GridCacheContext` `singleCacheContext(GridCacheSharedContext cctx)`
`IgniteTxEntry` `singleWrite()`
`Collection<CacheStoreManager>` `stores(GridCacheSharedContext cctx)`
`boolean` `storeWriteThrough(GridCacheSharedContext cctx)`
`CacheWriteSynchronizationMode` `syncMode(GridCacheSharedContext cctx)`
`GridDhtTopologyFuture` `topologyReadLock(GridCacheSharedContext cctx, GridFutureAdapter<?> fut)`
`void` `topologyReadUnlock(GridCacheSharedContext cctx)`
`void` `unwindEvicts(GridCacheSharedContext cctx)` Unwind evicts for caches involved in this transaction.
`IgniteCheckedException` `validateTopology(GridCacheSharedContext cctx, boolean read, GridDhtTopologyFuture topFut)`
`Collection<IgniteTxEntry>` `writeEntries()`
`Map<IgniteTxKey,IgniteTxEntry>` `writeMap()`
`Set<IgniteTxKey>` `writeSet()`

### Method Detail

#### implicitSingle

    boolean implicitSingle()

Returns:
  Flag indicating whether transaction is implicit with only one key.

#### firstCacheId

    @Nullable
    Integer firstCacheId()

Returns:
  First tx cache id.

#### unwindEvicts

    void unwindEvicts(GridCacheSharedContext cctx)

Unwind evicts for caches involved in this transaction.

Parameters:
  `cctx` - Grid cache shared context.

#### singleCacheContext

    @Nullable
    GridCacheContext singleCacheContext(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Context.
Returns:
  cctx Non-null cache context if tx has only one active cache.

#### awaitLastFuture

    void awaitLastFuture(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Awaits for previous async operations on active caches to be completed.

#### validateTopology

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

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

#### syncMode

    CacheWriteSynchronizationMode syncMode(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Context.
Returns:
  Write synchronization mode.

#### addActiveCache

    void addActiveCache(GridCacheContext cacheCtx,
                        boolean recovery,
                        IgniteTxLocalAdapter tx)
                 throws IgniteCheckedException

Parameters:
  `cacheCtx` - Context.
  `tx` - Transaction.
Throws:
  `IgniteCheckedException` - If cache check failed.

#### topologyReadLock

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

Parameters:
  `cctx` - Context.
  `fut` - Future to finish with error if some cache is stopping.
Returns:
  Topology future.

#### topologyReadUnlock

    void topologyReadUnlock(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Context.

#### storeWriteThrough

    boolean storeWriteThrough(GridCacheSharedContext cctx)

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

#### hasInterceptor

    boolean hasInterceptor(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Context.
Returns:
  `True` if transaction spans one or more caches with configured interceptor.

#### stores

    Collection<CacheStoreManager> stores(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Context.
Returns:
  Configured stores for active caches.

#### onTxEnd

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

Parameters:
  `cctx` - Context.
  `tx` - Transaction.
  `commit` - Commit flag.

#### entry

    @Nullable
    IgniteTxEntry entry(IgniteTxKey key)

Parameters:
  `key` - Key.
Returns:
  Entry.

#### hasWriteKey

    boolean hasWriteKey(IgniteTxKey key)

Parameters:
  `key` - Key.
Returns:
  `True` if tx has write key.

#### readSet

    Set<IgniteTxKey> readSet()

Returns:
  Read entries keys.

#### writeSet

    Set<IgniteTxKey> writeSet()

Returns:
  Write entries keys.

#### writeEntries

    Collection<IgniteTxEntry> writeEntries()

Returns:
  Write entries.

#### readEntries

    Collection<IgniteTxEntry> readEntries()

Returns:
  Read entries.

#### writeMap

    Map<IgniteTxKey,IgniteTxEntry> writeMap()

Returns:
  Write entries map.

#### readMap

    Map<IgniteTxKey,IgniteTxEntry> readMap()

Returns:
  Read entries map.

#### allEntries

    Collection<IgniteTxEntry> allEntries()

Returns:
  All entries.

#### singleWrite

    @Nullable
    IgniteTxEntry singleWrite()

Returns:
  Non-null entry if tx has only one write entry.

#### empty

    boolean empty()

Returns:
  `True` if transaction is empty.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.6.0
Release Date | : July 10 2018