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

## Class GridNearTxLocal

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter
  - - org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter
    - - org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter
      - - org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter
        - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal

All Implemented Interfaces:
  Externalizable, Serializable, AutoCloseable, MvccCoordinatorChangeAware, IgniteInternalTx, IgniteTxLocalEx, GridTimeoutObject

    public class GridNearTxLocal
    extends GridDhtTxLocalAdapter
    implements GridTimeoutObject, AutoCloseable, MvccCoordinatorChangeAware

Replicated user transaction.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`protected class` `GridNearTxLocal.FinishClosure<T>` Post-lock closure.

### Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter

`IgniteTxLocalAdapter.PLC1<T>, IgniteTxLocalAdapter.PLC2<T>, IgniteTxLocalAdapter.PMC<T>, IgniteTxLocalAdapter.PostLockClosure1<T>, IgniteTxLocalAdapter.PostLockClosure2<T>, IgniteTxLocalAdapter.PostMissClosure<T>`

### Nested classes/interfaces inherited from class org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter

`GridMetadataAwareAdapter.EntryKey`

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx

`IgniteInternalTx.FinalizationStatus`

### Field Summary

Fields
`protected boolean` `transform` If this transaction contains transform entries.

### Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter

`dhtMap, explicitLock, lockFut, mapped, nearMap, ROLLBACK_FUT`

### Fields inherited from class org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter

`COMMIT_ERR_UPD, commitErr, DONE_FLAG_UPD, doneFlag, implicitRes, minVer, qryEnlisted, syncMode, txState`

### Fields inherited from class org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter

`cctx, concurrency, consistentIdMapper, endVer, implicit, internal, invalidate, isDone, isolation, loc, log, mvccSnapshot, needRetVal, nodeId, onePhaseCommit, startTime, startVer, storeEnabled, subjId, taskName, taskNameHash, threadId, timeout, topVer, txNodes, txSize, writeVer, xidVer`

### Fields inherited from interface org.apache.ignite.internal.processors.cache.mvcc.MvccCoordinatorChangeAware

`ID_CNTR, ID_FILTER, MVCC_TRACKER_ID_NA`

### Constructor Summary

Constructors
Constructor and Description
`GridNearTxLocal()` Empty constructor required for `Externalizable`.
`GridNearTxLocal(GridCacheSharedContext ctx, boolean implicit, boolean implicitSingle, boolean sys, byte plc, TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, boolean storeEnabled, Boolean mvccOp, int txSize, @Nullable UUID subjId, int taskNameHash, @Nullable String lb, IgniteTxManager.TxDumpsThrottling txDumpsThrottling, boolean tracingEnabled)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected IgniteCacheExpiryPolicy` `accessPolicy(GridCacheContext cacheCtx, Collection<KeyCacheObject> keys)`
`protected IgniteCacheExpiryPolicy` `accessPolicy(GridCacheContext ctx, IgniteTxKey key, @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)`
`void` `addKeyMapping(IgniteTxKey key, ClusterNode node)` Adds key mapping to dht mapping.
`protected IgniteInternalFuture<Boolean>` `addReader(long msgId, GridDhtCacheEntry cached, IgniteTxEntry entry, AffinityTopologyVersion topVer)` Adds reader to cached entry.
`protected void` `clearPrepareFuture(GridDhtTxPrepareFuture fut)` Removes previously created prepare future from atomic reference.
`void` `close()`
`void` `close(boolean clearThreadMap)`
`boolean` `colocated()`
`boolean` `colocatedLocallyMapped()`
`void` `colocatedLocallyMapped(boolean colocatedLocallyMapped)`
`void` `commit()`
`IgniteInternalFuture<IgniteInternalTx>` `commitAsync()` Asynchronously commits this transaction by initiating `two-phase-commit` process.
`IgniteInternalFuture<IgniteInternalTx>` `commitAsyncLocal()` Commits local part of colocated transaction.
`IgniteInternalFuture<IgniteInternalTx>` `commitNearTxLocalAsync()`
`@Nullable IgniteInternalFuture<?>` `currentPrepareFuture()`
`long` `endTime()`
`void` `enterSystemSection()` Enters the section when system time for this transaction is counted.
`protected GridCacheEntryEx` `entryEx(GridCacheContext cacheCtx, IgniteTxKey key)` Gets cache entry for given key.
`protected GridCacheEntryEx` `entryEx(GridCacheContext cacheCtx, IgniteTxKey key, AffinityTopologyVersion topVer)` Gets cache entry for given key and topology version.
`<K,V> IgniteInternalFuture<Map<K,V>>` `getAllAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, Collection<KeyCacheObject> keys, boolean deserializeBinary, boolean skipVals, boolean keepCacheObjects, boolean skipStore, boolean recovery, boolean readRepair, boolean needVer)`
`boolean` `hasRemoteLocks()`
`void` `hasRemoteLocks(boolean hasRemoteLocks)`
`<K,V> IgniteInternalFuture<GridCacheReturn>` `invokeAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, K key, javax.cache.processor.EntryProcessor<K,V,Object> entryProcessor, Object... invokeArgs)`
`<K,V,T> IgniteInternalFuture<GridCacheReturn>` `invokeAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, @Nullable Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,Object>> map, Object... invokeArgs)`
`boolean` `isOperationAllowed(boolean mvccOp)`
`String` `label()` Returns label of transactions.
`void` `leaveSystemSection()` Leaves the section when system time for this transaction is counted.
`boolean` `localFinish(boolean commit, boolean clearThreadMap)` Finishes transaction (either commit or rollback).
`<K> IgniteInternalFuture<GridCacheReturn>` `lockAllAsync(GridCacheContext cacheCtx, Collection<? extends K> keys, boolean retval, boolean read, long createTtl, long accessTtl, boolean skipStore, boolean keepBinary)`
`IgniteTxMappings` `mappings()`
`boolean` `markExplicit(UUID nodeId)`
`void` `mvccSnapshot(MvccSnapshot mvccSnapshot)`
`boolean` `near()`
`protected IgniteUuid` `nearFutureId()`
`boolean` `nearLocallyMapped()`
`protected UUID` `nearNodeId()`
`GridCacheVersion` `nearXidVersion()`
`long` `onMvccCoordinatorChange(MvccCoordinator newCrd)` Mvcc coordinator change callback.
`boolean` `onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)` Callback invoked whenever there is a lock that has been acquired by this transaction for any of the participating entries.
`void` `onRemap(AffinityTopologyVersion topVer, boolean reset)`
`void` `onTimeout()` Timeout callback.
`Collection<IgniteTxEntry>` `optimisticLockEntries()` Gets a list of entries that needs to be locked on the next step of prepare stage of optimistic transaction.
`boolean` `ownsLock(GridCacheEntryEx entry)`
`boolean` `ownsLockUnsafe(GridCacheEntryEx entry)`
`void` `prepare(boolean awaitLastFuture)`
`IgniteInternalFuture<GridNearTxPrepareResponse>` `prepareAsyncLocal(GridNearTxPrepareRequest req)` Prepares next batch of entries in dht transaction.
`IgniteInternalFuture<?>` `prepareNearTxLocal()`
`TransactionProxy` `proxy()`
`<K,V> IgniteInternalFuture<GridCacheReturn>` `putAllAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, Map<? extends K,? extends V> map, boolean retval)`
`IgniteInternalFuture<?>` `putAllDrAsync(GridCacheContext cacheCtx, Map<KeyCacheObject,GridCacheDrInfo> drMap)`
`<K,V> IgniteInternalFuture<GridCacheReturn>` `putAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, K key, V val, boolean retval, CacheEntryPredicate filter)`
`boolean` `queryEnlisted()`
`<K,V> IgniteInternalFuture<GridCacheReturn>` `removeAllAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, Collection<? extends K> keys, boolean retval, CacheEntryPredicate filter, boolean singleRmv)`
`IgniteInternalFuture<?>` `removeAllDrAsync(GridCacheContext cacheCtx, Map<KeyCacheObject,GridCacheVersion> drMap)`
`boolean` `removeMapping(UUID nodeId)`
`IgniteInternalFuture<MvccSnapshot>` `requestSnapshot()` Requests version on coordinator.
`void` `resume()` Resumes transaction (possibly in another thread) if it was previously suspended.
`void` `rollback()`
`IgniteInternalFuture<IgniteInternalTx>` `rollbackAsync()` Asynchronously rollback this transaction.
`IgniteInternalFuture<IgniteInternalTx>` `rollbackAsyncLocal()` Rolls back local part of colocated transaction.
`IgniteInternalFuture<IgniteInternalTx>` `rollbackNearTxLocalAsync()`
`IgniteInternalFuture<IgniteInternalTx>` `rollbackNearTxLocalAsync(boolean clearThreadMap, boolean onTimeout)`
`TransactionProxy` `rollbackOnlyProxy()`
`IgniteInternalFuture<?>` `salvageTx()`
`protected void` `sendFinishReply(@Nullable Throwable err)`
`boolean` `state(TransactionState state)`
`void` `suspend()` Suspends transaction.
`long` `systemTimeCurrent()` Returns current amount of time that transaction has spent on system activities (acquiring locks, commiting, rolling back, etc.)
`void` `threadId(long threadId)`
`long` `timeout(long timeout)` Sets transaction timeout value.
`IgniteUuid` `timeoutId()`
`String` `toString()`
`IgniteInternalFuture<Long>` `updateAsync(GridCacheContext cacheCtx, int[] cacheIds, int[] parts, String schema, String qry, Object[] params, int flags, int pageSize, long timeout)`
`IgniteInternalFuture<Long>` `updateAsync(GridCacheContext cacheCtx, UpdateSourceIterator<?> it, int pageSize, long timeout, boolean sequential)`
`protected void` `updateExplicitVersion(IgniteTxEntry txEntry, GridCacheEntryEx entry)` Updates explicit version for tx entry based on current entry lock owner.

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter

`addEntry, addInvalidPartition, chainOnePhasePrepare, clearLockFuture, commitOnPrepare, explicitLock, explicitLock, finishFuture, incrementLockCounter, lockCounter, lockFuture, mapExplicitLocks, nearOnOriginatingNode, needsCompletedVersions, pendingVersions, span, span, tryRollbackAsync, updateLockFuture`

### Methods inherited from class org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter

`activeCachesDeploymentEnabled, activeCachesDeploymentEnabled, addActiveCache, addEntry, addInvokeResult, allEntries, alternateVersions, calculatePartitionUpdateCounters, checkValid, checkValid, commitAfterLock, commitError, commitError, committedVersions, completedBase, completedVersions, empty, entry, entryExpireTime, entryTtl, eventNodeId, hasInterceptor, hasWriteKey, implicitSingleResult, init, initResult, isStarted, markQueryEnlisted, masterNodeIds, minVersion, originatingNodeId, partsMap, peek, postLockWrite, readEntries, readMap, readSet, rolledbackVersions, seal, sendTransformedValues, syncMode, syncMode, tmFinish, touchPartition, txState, userCommit, userPrepare, userRollback, writeEntries, writeMap, writeSet`

### Methods inherited from class org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter

`applyTransformClosures, applyTxSizes, batchStoreCommit, chainState, checkInternal, commitVersion, commitVersion, concurrency, conflictResolve, context, dht, done, endVersion, equals, errorWhenCommitting, evictNearEntry, finalizationStatus, finishFuture, hashCode, heuristicException, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, isWriteToStoreFromDhtValid, local, localResult, log, logTxFinishErrorSafe, markFinalizing, mvccSnapshot, needReturnValue, needReturnValue, nodeId, onePhaseCommit, onePhaseCommit, optimistic, otherNodeId, ownedVersion, pessimistic, readCommitted, readExternal, readResolve, recordStateChangedEvent, remainingTime, remote, repeatableRead, resolveTaskName, rollbackException, rollbackFuture, rollbackFuture, serializable, sessionEnd, setParentTx, setRollbackOnly, size, skipCompletedVersions, skipCompletedVersions, startTime, state, state, storeEnabled, storeEnabled, storeWriteThrough, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeoutException, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, transactionNodes, txCounters, uncommit, updateNearCache, user, writeExternal, writeVersion, writeVersion, xid, xidVersion`

### Methods inherited from class org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter

`addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, readExternalMeta, removeAllMeta, removeMeta, removeMeta, replaceMeta, writeExternalMeta`

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

`finalize, getClass, notify, notifyAll, wait, wait, wait`

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

`addMeta, commitVersion, commitVersion, concurrency, dht, done, endVersion, errorWhenCommitting, finalizationStatus, finishFuture, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, local, localResult, markFinalizing, meta, mvccSnapshot, nodeId, onePhaseCommit, optimistic, otherNodeId, ownedVersion, pessimistic, readCommitted, remainingTime, removeMeta, repeatableRead, serializable, setRollbackOnly, size, startTime, state, storeEnabled, storeWriteThrough, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, txCounters, user, writeVersion, writeVersion, xid, xidVersion`

### Field Detail

#### transform

    protected boolean transform

If this transaction contains transform entries.

### Constructor Detail

#### GridNearTxLocal

    public GridNearTxLocal()

Empty constructor required for `Externalizable`.

#### GridNearTxLocal

    public GridNearTxLocal(GridCacheSharedContext ctx,
                           boolean implicit,
                           boolean implicitSingle,
                           boolean sys,
                           byte plc,
                           TransactionConcurrency concurrency,
                           TransactionIsolation isolation,
                           long timeout,
                           boolean storeEnabled,
                           Boolean mvccOp,
                           int txSize,
                           @Nullable
                           @Nullable UUID subjId,
                           int taskNameHash,
                           @Nullable
                           @Nullable String lb,
                           IgniteTxManager.TxDumpsThrottling txDumpsThrottling,
                           boolean tracingEnabled)

Parameters:
  `ctx` - Cache registry.
  `implicit` - Implicit flag.
  `implicitSingle` - Implicit with one key flag.
  `sys` - System flag.
  `plc` - IO policy.
  `concurrency` - Concurrency.
  `isolation` - Isolation.
  `timeout` - Timeout.
  `storeEnabled` - Store enabled flag.
  `mvccOp` - Whether this transaction was started via SQL API or not, or `null` if unknown.
  `txSize` - Transaction size.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash code.
  `lb` - Label.
  `txDumpsThrottling` - Log throttling information.
  `tracingEnabled` - `true` if the transaction should be traced.

### Method Detail

#### near

    public boolean near()

Specified by:
  `near` in interface `IgniteInternalTx`
Overrides:
  `near` in class `IgniteTxAdapter`
Returns:
  `True` if near transaction.

#### colocated

    public boolean colocated()

Specified by:
  `colocated` in interface `IgniteInternalTx`
Overrides:
  `colocated` in class `IgniteTxAdapter`
Returns:
  `True` if dht colocated transaction.

#### nearXidVersion

    public GridCacheVersion nearXidVersion()

Specified by:
  `nearXidVersion` in interface `IgniteInternalTx`
Overrides:
  `nearXidVersion` in class `IgniteTxAdapter`
Returns:
  Near transaction ID.

#### nearNodeId

    protected UUID nearNodeId()

Specified by:
  `nearNodeId` in class `GridDhtTxLocalAdapter`
Returns:
  Near node id.

#### nearFutureId

    protected IgniteUuid nearFutureId()

Specified by:
  `nearFutureId` in class `GridDhtTxLocalAdapter`
Returns:
  Near future ID.

#### addReader

    protected IgniteInternalFuture<Boolean> addReader(long msgId,
                                                      GridDhtCacheEntry cached,
                                                      IgniteTxEntry entry,
                                                      AffinityTopologyVersion topVer)

Adds reader to cached entry.

Specified by:
  `addReader` in class `GridDhtTxLocalAdapter`
Parameters:
  `msgId` - Message ID.
  `cached` - Cached entry.
  `entry` - Transaction entry.
  `topVer` - Topology version.
Returns:
  `True` if reader was added as a result of this call.

#### sendFinishReply

    protected void sendFinishReply(@Nullable
                                   @Nullable Throwable err)

Specified by:
  `sendFinishReply` in class `GridDhtTxLocalAdapter`
Parameters:
  `err` - Error, if any.

#### clearPrepareFuture

    protected void clearPrepareFuture(GridDhtTxPrepareFuture fut)

Removes previously created prepare future from atomic reference.

Specified by:
  `clearPrepareFuture` in class `GridDhtTxLocalAdapter`
Parameters:
  `fut` - Expected future.

#### nearLocallyMapped

    public boolean nearLocallyMapped()

Returns:
  `True` if transaction contains at least one near cache key mapped to the local node.

#### colocatedLocallyMapped

    public boolean colocatedLocallyMapped()

Returns:
  `True` if transaction contains colocated key mapped to the local node.

#### colocatedLocallyMapped

    public void colocatedLocallyMapped(boolean colocatedLocallyMapped)

Parameters:
  `colocatedLocallyMapped` - `True` if transaction contains colocated key mapped to the local node.

#### ownsLockUnsafe

    public boolean ownsLockUnsafe(GridCacheEntryEx entry)

Specified by:
  `ownsLockUnsafe` in interface `IgniteInternalTx`
Overrides:
  `ownsLockUnsafe` in class `IgniteTxAdapter`
Parameters:
  `entry` - Entry to check.
Returns:
  `True` if lock is owned.

#### timeout

    public long timeout(long timeout)

Sets transaction timeout value. This value can be set only before a first operation on transaction has been performed.

Specified by:
  `timeout` in interface `IgniteInternalTx`
Overrides:
  `timeout` in class `IgniteTxAdapter`
Parameters:
  `timeout` - Transaction timeout value.
Returns:
  Previous timeout.

#### ownsLock

    public boolean ownsLock(GridCacheEntryEx entry)
                     throws GridCacheEntryRemovedException

Specified by:
  `ownsLock` in interface `IgniteInternalTx`
Overrides:
  `ownsLock` in class `IgniteTxAdapter`
Parameters:
  `entry` - Entry to check.
Returns:
  `True` if lock is owned.
Throws:
  `GridCacheEntryRemovedException` - If entry has been removed.

#### putAllAsync

    public <K,V> IgniteInternalFuture<GridCacheReturn> putAllAsync(GridCacheContext cacheCtx,
                                                                   @Nullable
                                                                   @Nullable AffinityTopologyVersion entryTopVer,
                                                                   Map<? extends K,? extends V> map,
                                                                   boolean retval)

Parameters:
  `cacheCtx` - Cache context.
  `map` - Map to put.
  `retval` - Flag indicating whether a value should be returned.
Returns:
  Future for put operation.

#### putAsync

    public final <K,V> IgniteInternalFuture<GridCacheReturn> putAsync(GridCacheContext cacheCtx,
                                                                      @Nullable
                                                                      @Nullable AffinityTopologyVersion entryTopVer,
                                                                      K key,
                                                                      V val,
                                                                      boolean retval,
                                                                      CacheEntryPredicate filter)

Parameters:
  `cacheCtx` - Cache context.
  `key` - Key.
  `val` - Value.
  `retval` - Return value flag.
  `filter` - Filter.
Returns:
  Future for put operation.

#### invokeAsync

    public <K,V> IgniteInternalFuture<GridCacheReturn> invokeAsync(GridCacheContext cacheCtx,
                                                                   @Nullable
                                                                   @Nullable AffinityTopologyVersion entryTopVer,
                                                                   K key,
                                                                   javax.cache.processor.EntryProcessor<K,V,Object> entryProcessor,
                                                                   Object... invokeArgs)

Parameters:
  `cacheCtx` - Cache context.
  `key` - Key.
  `entryProcessor` - Entry processor.
  `invokeArgs` - Optional arguments for entry processor.
Returns:
  Operation future.

#### invokeAsync

    public <K,V,T> IgniteInternalFuture<GridCacheReturn> invokeAsync(GridCacheContext cacheCtx,
                                                                     @Nullable
                                                                     @Nullable AffinityTopologyVersion entryTopVer,
                                                                     @Nullable
                                                                     @Nullable Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,Object>> map,
                                                                     Object... invokeArgs)

Parameters:
  `cacheCtx` - Cache context.
  `map` - Entry processors map.
  `invokeArgs` - Optional arguments for entry processor.
Returns:
  Operation future.

#### putAllDrAsync

    public IgniteInternalFuture<?> putAllDrAsync(GridCacheContext cacheCtx,
                                                 Map<KeyCacheObject,GridCacheDrInfo> drMap)

Parameters:
  `cacheCtx` - Cache context.
  `drMap` - DR map to put.
Returns:
  Future for DR put operation.

#### removeAllDrAsync

    public IgniteInternalFuture<?> removeAllDrAsync(GridCacheContext cacheCtx,
                                                    Map<KeyCacheObject,GridCacheVersion> drMap)

Parameters:
  `cacheCtx` - Cache context.
  `drMap` - DR map.
Returns:
  Future for asynchronous remove.

#### removeAllAsync

    public <K,V> IgniteInternalFuture<GridCacheReturn> removeAllAsync(GridCacheContext cacheCtx,
                                                                      @Nullable
                                                                      @Nullable AffinityTopologyVersion entryTopVer,
                                                                      Collection<? extends K> keys,
                                                                      boolean retval,
                                                                      CacheEntryPredicate filter,
                                                                      boolean singleRmv)

Parameters:
  `cacheCtx` - Cache context.
  `keys` - Keys to remove.
  `retval` - Flag indicating whether a value should be returned.
  `filter` - Filter.
  `singleRmv` - `True` for single key remove operation (`Cache.remove(Object)`.
Returns:
  Future for asynchronous remove.

#### updateAsync

    public IgniteInternalFuture<Long> updateAsync(GridCacheContext cacheCtx,
                                                  int[] cacheIds,
                                                  int[] parts,
                                                  String schema,
                                                  String qry,
                                                  Object[] params,
                                                  int flags,
                                                  int pageSize,
                                                  long timeout)

Parameters:
  `cacheCtx` - Cache context.
  `cacheIds` - Involved cache ids.
  `parts` - Partitions.
  `schema` - Schema name.
  `qry` - Query string.
  `params` - Query parameters.
  `flags` - Flags.
  `pageSize` - Fetch page size.
  `timeout` - Timeout.
Returns:
  Operation future.

#### updateAsync

    public IgniteInternalFuture<Long> updateAsync(GridCacheContext cacheCtx,
                                                  UpdateSourceIterator<?> it,
                                                  int pageSize,
                                                  long timeout,
                                                  boolean sequential)

Parameters:
  `cacheCtx` - Cache context.
  `it` - Entries iterator.
  `pageSize` - Page size.
  `timeout` - Timeout.
  `sequential` - Sequential locking flag.
Returns:
  Operation future.

#### getAllAsync

    public <K,V> IgniteInternalFuture<Map<K,V>> getAllAsync(GridCacheContext cacheCtx,
                                                            @Nullable
                                                            @Nullable AffinityTopologyVersion entryTopVer,
                                                            Collection<KeyCacheObject> keys,
                                                            boolean deserializeBinary,
                                                            boolean skipVals,
                                                            boolean keepCacheObjects,
                                                            boolean skipStore,
                                                            boolean recovery,
                                                            boolean readRepair,
                                                            boolean needVer)

Parameters:
  `cacheCtx` - Cache context.
  `keys` - Keys to get.
  `deserializeBinary` - Deserialize binary flag.
  `skipVals` - Skip values flag.
  `keepCacheObjects` - Keep cache objects
  `skipStore` - Skip store flag.
  `readRepair` - Read Repair flag.
Returns:
  Future for this get.

#### optimisticLockEntries

    public Collection<IgniteTxEntry> optimisticLockEntries()

Gets a list of entries that needs to be locked on the next step of prepare stage of optimistic transaction.

Specified by:
  `optimisticLockEntries` in interface `IgniteInternalTx`
Overrides:
  `optimisticLockEntries` in class `IgniteTxAdapter`
Returns:
  List of tx entries for optimistic locking.

#### updateExplicitVersion

    protected void updateExplicitVersion(IgniteTxEntry txEntry,
                                         GridCacheEntryEx entry)
                                  throws GridCacheEntryRemovedException

Updates explicit version for tx entry based on current entry lock owner.

Overrides:
  `updateExplicitVersion` in class `IgniteTxLocalAdapter`
Parameters:
  `txEntry` - Tx entry to update.
  `entry` - Entry.
Throws:
  `GridCacheEntryRemovedException` - If entry was concurrently removed.

#### mappings

    public IgniteTxMappings mappings()

Returns:
  DHT map.

#### removeMapping

    public boolean removeMapping(UUID nodeId)

Overrides:
  `removeMapping` in class `GridDhtTxLocalAdapter`
Parameters:
  `nodeId` - Undo mapping.
Returns:
  `True` if mapping was removed.

#### queryEnlisted

    public boolean queryEnlisted()

Overrides:
  `queryEnlisted` in class `IgniteTxLocalAdapter`
Returns:
  `True` if there are entries, enlisted by query.

#### requestSnapshot

    public IgniteInternalFuture<MvccSnapshot> requestSnapshot()

Requests version on coordinator.

Returns:
  Future to wait for result.

#### onMvccCoordinatorChange

    public long onMvccCoordinatorChange(MvccCoordinator newCrd)

Mvcc coordinator change callback.

Specified by:
  `onMvccCoordinatorChange` in interface `MvccCoordinatorChangeAware`
Parameters:
  `newCrd` - New mvcc coordinator.
Returns:
  Query id if exists.

#### mvccSnapshot

    public void mvccSnapshot(MvccSnapshot mvccSnapshot)

Specified by:
  `mvccSnapshot` in interface `IgniteInternalTx`
Overrides:
  `mvccSnapshot` in class `IgniteTxAdapter`
Parameters:
  `mvccSnapshot` - Mvcc snapshot.

#### addKeyMapping

    public void addKeyMapping(IgniteTxKey key,
                              ClusterNode node)

Adds key mapping to dht mapping.

Parameters:
  `key` - Key to add.
  `node` - Node this key mapped to.

#### suspend

    public void suspend()
                 throws IgniteCheckedException

Suspends transaction. It could be resumed later. Supported only for optimistic transactions.

Throws:
  `IgniteCheckedException` - If the transaction is in an incorrect state, or timed out.

#### resume

    public void resume()
                throws IgniteCheckedException

Resumes transaction (possibly in another thread) if it was previously suspended.

Throws:
  `IgniteCheckedException` - If the transaction is in an incorrect state, or timed out.

#### markExplicit

    public boolean markExplicit(UUID nodeId)

Parameters:
  `nodeId` - Node ID to mark with explicit lock.
Returns:
  `True` if mapping was found.

#### onOwnerChanged

    public boolean onOwnerChanged(GridCacheEntryEx entry,
                                  GridCacheMvccCandidate owner)

Callback invoked whenever there is a lock that has been acquired by this transaction for any of the participating entries.

Specified by:
  `onOwnerChanged` in interface `IgniteInternalTx`
Overrides:
  `onOwnerChanged` in class `IgniteTxLocalAdapter`
Parameters:
  `entry` - Cache entry.
  `owner` - Lock candidate that won ownership of the lock.
Returns:
  `True` if transaction cared about notification.

#### localFinish

    public boolean localFinish(boolean commit,
                               boolean clearThreadMap)
                        throws IgniteCheckedException

Finishes transaction (either commit or rollback).

Specified by:
  `localFinish` in interface `IgniteTxLocalEx`
Overrides:
  `localFinish` in class `GridDhtTxLocalAdapter`
Parameters:
  `commit` - `True` if commit, `false` if rollback.
  `clearThreadMap` - If `true` removes `GridNearTxLocal` from thread map.
Returns:
  `True` if state has been changed.
Throws:
  `IgniteCheckedException` - If finish failed.

#### systemTimeCurrent

    public long systemTimeCurrent()

Returns current amount of time that transaction has spent on system activities (acquiring locks, commiting, rolling back, etc.)

Returns:
  Amount of time in milliseconds.

#### state

    public boolean state(TransactionState state)

Specified by:
  `state` in interface `IgniteInternalTx`
Overrides:
  `state` in class `IgniteTxAdapter`
Parameters:
  `state` - Transaction state.
Returns:
  `True` if transition was valid, `false` otherwise.

#### prepareNearTxLocal

    public IgniteInternalFuture<?> prepareNearTxLocal()

Returns:
  Tx prepare future.

#### salvageTx

    public IgniteInternalFuture<?> salvageTx()

Specified by:
  `salvageTx` in interface `IgniteInternalTx`
Returns:
  Future.

#### prepare

    public final void prepare(boolean awaitLastFuture)
                       throws IgniteCheckedException

Parameters:
  `awaitLastFuture` - If true - method will wait until transaction finish every action started before.
Throws:
  `IgniteCheckedException` - If failed.

#### commit

    public void commit()
                throws IgniteCheckedException

Throws:
  `IgniteCheckedException` - If failed.

#### commitNearTxLocalAsync

    public IgniteInternalFuture<IgniteInternalTx> commitNearTxLocalAsync()

Returns:
  Finish future.

#### commitAsync

    public IgniteInternalFuture<IgniteInternalTx> commitAsync()

Asynchronously commits this transaction by initiating `two-phase-commit` process.

Specified by:
  `commitAsync` in interface `IgniteInternalTx`
Returns:
  Future for commit operation.

#### rollback

    public void rollback()
                  throws IgniteCheckedException

Throws:
  `IgniteCheckedException` - If failed.

#### rollbackNearTxLocalAsync

    public IgniteInternalFuture<IgniteInternalTx> rollbackNearTxLocalAsync()

Returns:
  Rollback future.

#### rollbackNearTxLocalAsync

    public IgniteInternalFuture<IgniteInternalTx> rollbackNearTxLocalAsync(boolean clearThreadMap,
                                                                           boolean onTimeout)

Parameters:
  `clearThreadMap` - `True` if needed to clear thread map.
  `onTimeout` - `True` if called from timeout handler. Note: For async rollbacks (from timeouts or another thread) should not clear thread map since thread started tx still should be able to see this tx to prevent subsequent operations.
Returns:
  Rollback future.

#### rollbackAsync

    public IgniteInternalFuture<IgniteInternalTx> rollbackAsync()

Asynchronously rollback this transaction.

Specified by:
  `rollbackAsync` in interface `IgniteInternalTx`
Returns:
  Rollback future.

#### prepareAsyncLocal

    public IgniteInternalFuture<GridNearTxPrepareResponse> prepareAsyncLocal(GridNearTxPrepareRequest req)

Prepares next batch of entries in dht transaction.

Parameters:
  `req` - Prepare request.
Returns:
  Future that will be completed when locks are acquired.

#### commitAsyncLocal

    public IgniteInternalFuture<IgniteInternalTx> commitAsyncLocal()

Commits local part of colocated transaction.

Returns:
  Commit future.

#### rollbackAsyncLocal

    public IgniteInternalFuture<IgniteInternalTx> rollbackAsyncLocal()

Rolls back local part of colocated transaction.

Returns:
  Commit future.

#### lockAllAsync

    public <K> IgniteInternalFuture<GridCacheReturn> lockAllAsync(GridCacheContext cacheCtx,
                                                                  Collection<? extends K> keys,
                                                                  boolean retval,
                                                                  boolean read,
                                                                  long createTtl,
                                                                  long accessTtl,
                                                                  boolean skipStore,
                                                                  boolean keepBinary)

Type Parameters:
  `K` - Key type.
Parameters:
  `cacheCtx` - Cache context.
  `keys` - Keys.
  `retval` - Return value flag.
  `read` - Read flag.
  `createTtl` - Create ttl.
  `accessTtl` - Access ttl.
  `skipStore` - Skip store flag.
  `keepBinary` - Keep binary flag.
Returns:
  Future with respond.

#### entryEx

    protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx,
                                       IgniteTxKey key)

Gets cache entry for given key.

Overrides:
  `entryEx` in class `IgniteTxLocalAdapter`
Parameters:
  `cacheCtx` - Cache context.
  `key` - Key.
Returns:
  Cache entry.

#### entryEx

    protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx,
                                       IgniteTxKey key,
                                       AffinityTopologyVersion topVer)

Gets cache entry for given key and topology version.

Overrides:
  `entryEx` in class `IgniteTxLocalAdapter`
Parameters:
  `cacheCtx` - Cache context.
  `key` - Key.
  `topVer` - Topology version.
Returns:
  Cache entry.

#### accessPolicy

    protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx,
                                                   IgniteTxKey key,
                                                   @Nullable
                                                   @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)

Overrides:
  `accessPolicy` in class `IgniteTxLocalAdapter`
Parameters:
  `ctx` - Cache context.
  `key` - Key.
  `expiryPlc` - Expiry policy.
Returns:
  Expiry policy wrapper for entries accessed locally in optimistic transaction.

#### accessPolicy

    protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext cacheCtx,
                                                   Collection<KeyCacheObject> keys)

Overrides:
  `accessPolicy` in class `IgniteTxLocalAdapter`
Parameters:
  `cacheCtx` - Cache context.
  `keys` - Keys.
Returns:
  Expiry policy.

#### close

    public void close()
               throws IgniteCheckedException

Specified by:
  `close` in interface `AutoCloseable`
Throws:
  `IgniteCheckedException`

#### close

    public void close(boolean clearThreadMap)
               throws IgniteCheckedException

Parameters:
  `clearThreadMap` - Clear thread map.
Throws:
  `IgniteCheckedException`

#### currentPrepareFuture

    @Nullable
    public @Nullable IgniteInternalFuture<?> currentPrepareFuture()

Specified by:
  `currentPrepareFuture` in interface `IgniteInternalTx`
Overrides:
  `currentPrepareFuture` in class `IgniteTxAdapter`
Returns:
  Future for transaction prepare if prepare is in progress.

#### onRemap

    public void onRemap(AffinityTopologyVersion topVer,
                        boolean reset)

Parameters:
  `topVer` - New topology version.
  `reset` - `True` if need to reset tx state.

#### hasRemoteLocks

    public void hasRemoteLocks(boolean hasRemoteLocks)

Parameters:
  `hasRemoteLocks` - `True` if tx has remote locks acquired.

#### hasRemoteLocks

    public boolean hasRemoteLocks()

Returns:
  `True` if tx has remote locks acquired.

#### isOperationAllowed

    public boolean isOperationAllowed(boolean mvccOp)

Returns:
  `true` if this transaction does not have type flag set or it matches invoking operation, `false` otherwise.

#### proxy

    public TransactionProxy proxy()

Returns:
  Public API proxy.

#### rollbackOnlyProxy

    public TransactionProxy rollbackOnlyProxy()

Returns:
  Public API proxy.

#### threadId

    public void threadId(long threadId)

Parameters:
  `threadId` - new owner of transaction.

#### timeoutId

    public IgniteUuid timeoutId()

Specified by:
  `timeoutId` in interface `GridTimeoutObject`
Returns:
  ID of the object.

#### endTime

    public long endTime()

Specified by:
  `endTime` in interface `GridTimeoutObject`
Returns:
  End time.

#### label

    public String label()

Returns label of transactions.

Specified by:
  `label` in interface `IgniteInternalTx`
Returns:
  Label of transaction or `null` if there was not set.

#### onTimeout

    public void onTimeout()

Timeout callback.

Specified by:
  `onTimeout` in interface `GridTimeoutObject`

#### enterSystemSection

    public void enterSystemSection()

Enters the section when system time for this transaction is counted.

#### leaveSystemSection

    public void leaveSystemSection()

Leaves the section when system time for this transaction is counted.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDhtTxLocalAdapter`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020