Package org.apache.ignite.internal.processors.cache.distributed.dht

## Class GridDhtTxRemote

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter
  - - org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxRemoteAdapter
      - - org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxRemote

All Implemented Interfaces:
  `IgniteInternalTx`, `IgniteTxRemoteEx`

    public class GridDhtTxRemote
    extends GridDistributedTxRemoteAdapter

Transaction created by system implicitly on remote nodes.

### Nested Class Summary

### 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 inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxRemoteAdapter

`txState`

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

`cctx, concurrency, consistentIdMapper, deploymentLdrId, implicit, invalidate, isDone, isolation, log, nodeId, onePhaseCommit, startTime, taskName, threadId, topVer, txNodes, txSize, xidVer`

### Constructor Summary

Constructors

`GridDhtTxRemote​(GridCacheSharedContext ctx, UUID nearNodeId, UUID nodeId, AffinityTopologyVersion topVer, GridCacheVersion xidVer, GridCacheVersion commitVer, boolean sys, byte plc, TransactionConcurrency concurrency, TransactionIsolation isolation, boolean invalidate, long timeout, int txSize, GridCacheVersion nearXidVer, Map<UUID,​Collection<UUID>> txNodes, @Nullable UUID subjId, int taskNameHash, boolean single, boolean storeWriteThrough, @Nullable String txLbl)`

This constructor is meant for optimistic transactions.

`GridDhtTxRemote​(GridCacheSharedContext ctx, UUID nearNodeId, UUID nodeId, GridCacheVersion nearXidVer, AffinityTopologyVersion topVer, GridCacheVersion xidVer, GridCacheVersion commitVer, boolean sys, byte plc, TransactionConcurrency concurrency, TransactionIsolation isolation, boolean invalidate, long timeout, int txSize, @Nullable UUID subjId, int taskNameHash, boolean storeWriteThrough, @Nullable String txLbl)`

This constructor is meant for pessimistic transactions.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addInvalidPartition​(int cacheId, int part)`
`void` `addWrite​(GridCacheContext cacheCtx, GridCacheOperation op, IgniteTxKey key, @Nullable CacheObject val, @Nullable Collection<T2<javax.cache.processor.EntryProcessor<Object,​Object,​Object>,​Object[]>> entryProcessors, long ttl, boolean skipStore, boolean keepBinary)`
`void` `addWrite​(IgniteTxEntry entry, ClassLoader ldr)`
`boolean` `dht()`
`UUID` `eventNodeId()`
`Collection<UUID>` `masterNodeIds()`
`UUID` `nearNodeId()`
`GridCacheVersion` `nearXidVersion()`
`UUID` `otherNodeId()` Gets ID of additional node involved.
`boolean` `remote()`
`boolean` `storeWriteThrough()`
`String` `toString()`
`protected boolean` `updateNearCache​(GridCacheContext cacheCtx, KeyCacheObject key, AffinityTopologyVersion topVer)` Checks whether near cache should be updated.

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

`activeCachesDeploymentEnabled, activeCachesDeploymentEnabled, addActiveCache, addExplicit, allEntries, alternateVersions, clearEntry, commitAsync, commitError, commitRemoteTx, doneRemote, empty, entry, forceCommit, hasWriteKey, invalidate, isStarted, label, onOwnerChanged, originatingNodeId, peek, prepareRemoteTx, readEntries, readMap, readSet, rollbackAsync, rollbackRemoteTx, salvageTx, seal, txState, writeEntries, writeMap, writeSet`

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

`applyTransformClosures, applyTxSizes, batchStoreCommit, chainState, checkInternal, colocated, commitVersion, commitVersion, completedVersions, concurrency, conflictResolve, context, currentPrepareFuture, done, equals, errorWhenCommitting, evictNearEntry, finalizationStatus, finishFuture, hashCode, heuristicException, implicit, implicitSingle, incrementalSnapshotId, incrementalSnapshotId, internal, invalidPartitions, ioPolicy, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, isWriteToStoreFromDhtValid, local, localResult, log, logTxFinishErrorSafe, markFinalizing, near, needReturnValue, needReturnValue, needsCompletedVersions, nodeId, onePhaseCommit, onePhaseCommit, optimistic, optimisticLockEntries, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, readCommitted, recordStateChangedEvent, remainingTime, repeatableRead, resolveTaskName, rollbackException, serializable, sessionEnd, setParentTx, setRollbackOnly, size, skipCompletedVersions, skipCompletedVersions, startTime, startTimeNanos, state, state, state, storeEnabled, storeEnabled, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, timeoutException, timeoutException, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, transactionNodes, txCounters, uncommit, user, 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, removeAllMeta, removeMeta, removeMeta, replaceMeta`

### 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, colocated, commitVersion, commitVersion, completedVersions, concurrency, currentPrepareFuture, done, errorWhenCommitting, finalizationStatus, finishFuture, implicit, implicitSingle, incrementalSnapshotId, incrementalSnapshotId, internal, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, local, localResult, markFinalizing, meta, near, needsCompletedVersions, nodeId, onePhaseCommit, optimistic, optimisticLockEntries, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, readCommitted, remainingTime, removeMeta, repeatableRead, serializable, setRollbackOnly, size, startTime, startTimeNanos, state, state, storeEnabled, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, txCounters, user, writeVersion, writeVersion, xid, xidVersion`

### Constructor Detail

#### GridDhtTxRemote

    public GridDhtTxRemote​(GridCacheSharedContext ctx,
                           UUID nearNodeId,
                           UUID nodeId,
                           AffinityTopologyVersion topVer,
                           GridCacheVersion xidVer,
                           GridCacheVersion commitVer,
                           boolean sys,
                           byte plc,
                           TransactionConcurrency concurrency,
                           TransactionIsolation isolation,
                           boolean invalidate,
                           long timeout,
                           int txSize,
                           GridCacheVersion nearXidVer,
                           Map<UUID,​Collection<UUID>> txNodes,
                           @Nullable
                           @Nullable UUID subjId,
                           int taskNameHash,
                           boolean single,
                           boolean storeWriteThrough,
                           @Nullable
                           @Nullable String txLbl)

This constructor is meant for optimistic transactions.

Parameters:
  `ctx` - Cache context.
  `nearNodeId` - Near node ID.
  `nodeId` - Node ID.
  `topVer` - Topology version.
  `xidVer` - XID version.
  `commitVer` - Commit version.
  `sys` - System flag.
  `concurrency` - Concurrency level (should be pessimistic).
  `isolation` - Transaction isolation.
  `invalidate` - Invalidate flag.
  `timeout` - Timeout.
  `txSize` - Expected transaction size.
  `nearXidVer` - Near transaction ID.
  `txNodes` - Transaction nodes mapping.
  `storeWriteThrough` - Cache store write through flag.
  `txLbl` - Transaction label.

#### GridDhtTxRemote

    public GridDhtTxRemote​(GridCacheSharedContext ctx,
                           UUID nearNodeId,
                           UUID nodeId,
                           GridCacheVersion nearXidVer,
                           AffinityTopologyVersion topVer,
                           GridCacheVersion xidVer,
                           GridCacheVersion commitVer,
                           boolean sys,
                           byte plc,
                           TransactionConcurrency concurrency,
                           TransactionIsolation isolation,
                           boolean invalidate,
                           long timeout,
                           int txSize,
                           @Nullable
                           @Nullable UUID subjId,
                           int taskNameHash,
                           boolean storeWriteThrough,
                           @Nullable
                           @Nullable String txLbl)

This constructor is meant for pessimistic transactions.

Parameters:
  `ctx` - Cache context.
  `nearNodeId` - Near node ID.
  `nodeId` - Node ID.
  `nearXidVer` - Near transaction ID.
  `topVer` - Topology version.
  `xidVer` - XID version.
  `commitVer` - Commit version.
  `sys` - System flag.
  `concurrency` - Concurrency level (should be pessimistic).
  `isolation` - Transaction isolation.
  `invalidate` - Invalidate flag.
  `timeout` - Timeout.
  `txSize` - Expected transaction size.
  `storeWriteThrough` - Cache store write through flag.
  `txLbl` - Transaction label.

### Method Detail

#### remote

    public boolean remote()

Overrides:
  `remote` in class `IgniteTxAdapter`
Returns:
  True if transaction reflects changes in primary -> backup direction.

#### dht

    public boolean dht()

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

#### storeWriteThrough

    public boolean storeWriteThrough()

Specified by:
  `storeWriteThrough` in interface `IgniteInternalTx`
Overrides:
  `storeWriteThrough` in class `IgniteTxAdapter`
Returns:
  `True` if transaction is allowed to use store and transactions spans one or more caches with store enabled.

#### eventNodeId

    public UUID eventNodeId()

Specified by:
  `eventNodeId` in interface `IgniteInternalTx`
Overrides:
  `eventNodeId` in class `GridDistributedTxRemoteAdapter`
Returns:
  Event node ID.

#### masterNodeIds

    public Collection<UUID> masterNodeIds()

Returns:
  Master node IDs.

#### otherNodeId

    public UUID otherNodeId()

Gets ID of additional node involved. For example, in DHT case, other node is near node ID.

Specified by:
  `otherNodeId` in interface `IgniteInternalTx`
Overrides:
  `otherNodeId` in class `IgniteTxAdapter`
Returns:
  Parent node IDs.

#### nearXidVersion

    public GridCacheVersion nearXidVersion()

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

#### nearNodeId

    public UUID nearNodeId()

Returns:
  Near node ID.

#### updateNearCache

    protected boolean updateNearCache​(GridCacheContext cacheCtx,
                                      KeyCacheObject key,
                                      AffinityTopologyVersion topVer)

Checks whether near cache should be updated.

Overrides:
  `updateNearCache` in class `IgniteTxAdapter`
Returns:
  Flag indicating whether near cache should be updated.

#### addInvalidPartition

    public void addInvalidPartition​(int cacheId,
                                    int part)

Specified by:
  `addInvalidPartition` in interface `IgniteInternalTx`
Overrides:
  `addInvalidPartition` in class `IgniteTxAdapter`
Parameters:
  `cacheId` - Cache id.
  `part` - Invalid partition.

#### addWrite

    public void addWrite​(IgniteTxEntry entry,
                         ClassLoader ldr)
                  throws IgniteCheckedException

Parameters:
  `entry` - Write entry.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### addWrite

    public void addWrite​(GridCacheContext cacheCtx,
                         GridCacheOperation op,
                         IgniteTxKey key,
                         @Nullable
                         @Nullable CacheObject val,
                         @Nullable
                         @Nullable Collection<T2<javax.cache.processor.EntryProcessor<Object,​Object,​Object>,​Object[]>> entryProcessors,
                         long ttl,
                         boolean skipStore,
                         boolean keepBinary)

Parameters:
  `cacheCtx` - Cache context.
  `op` - Write operation.
  `key` - Key to add to write set.
  `val` - Value.
  `entryProcessors` - Entry processors.
  `ttl` - TTL.
  `skipStore` - Skip store flag.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedTxRemoteAdapter`