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:
  Externalizable, Serializable, IgniteInternalTx, IgniteTxRemoteEx

    public class GridDhtTxRemote
    extends GridDistributedTxRemoteAdapter

Transaction created by system implicitly on remote nodes.

See Also:
  Serialized Form

### 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, endVer, implicit, internal, invalidate, isDone, isolation, loc, log, needRetVal, nodeId, onePhaseCommit, startTime, startVer, storeEnabled, subjId, taskName, taskNameHash, threadId, timeout, topVer, txNodes, txSize, writeVer, xidVer`

### Constructor Summary

Constructors
Constructor and Description
`GridDhtTxRemote()` Empty constructor required for `Externalizable`.

`GridDhtTxRemote(GridCacheSharedContext ctx, UUID nearNodeId, IgniteUuid rmtFutId, 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, UUID subjId, int taskNameHash, boolean single)`
This constructor is meant for optimistic transactions.

`GridDhtTxRemote(GridCacheSharedContext ctx, UUID nearNodeId, IgniteUuid rmtFutId, UUID nodeId, GridCacheVersion nearXidVer, AffinityTopologyVersion topVer, GridCacheVersion xidVer, GridCacheVersion commitVer, boolean sys, byte plc, TransactionConcurrency concurrency, TransactionIsolation isolation, boolean invalidate, long timeout, int txSize, UUID subjId, int taskNameHash)`
This constructor is meant for pessimistic transactions.

### Method Summary

Methods
`void` `addInvalidPartition(GridCacheContext cacheCtx, int part)`
`void` `addWrite(GridCacheContext cacheCtx, GridCacheOperation op, IgniteTxKey key, CacheObject val, 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.
`String` `toString()`
`void` `transactionNodes(Map<UUID,Collection<UUID>> txNodes)`
`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, addExplicit, allEntries, alternateVersions, clearEntry, commitAsync, commitError, commitRemoteTx, doneRemote, empty, entry, forceCommit, hasWriteKey, invalidate, isStarted, onOwnerChanged, originatingNodeId, peek, prepareRemoteTx, readEntries, readMap, readSet, rollbackAsync, rollbackRemoteTx, salvageTx, seal, setPartitionUpdateCounters, txState, writeEntries, writeMap, writeSet`

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

`applyTransformClosures, batchStoreCommit, checkInternal, colocated, commitVersion, commitVersion, completedVersions, concurrency, conflictResolve, currentPrepareFuture, done, endVersion, equals, errorWhenCommitting, evictNearEntry, finalizationStatus, finishFuture, hashCode, implicit, implicitSingle, internal, invalidPartitions, ioPolicy, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, isWriteToStoreFromDhtValid, local, localResult, log, markFinalizing, near, needReturnValue, needReturnValue, needsCompletedVersions, nodeId, onePhaseCommit, onePhaseCommit, optimistic, optimisticLockEntries, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, readCommitted, readExternal, readResolve, remainingTime, repeatableRead, resolveTaskName, serializable, sessionEnd, setRollbackOnly, size, startTime, state, state, state, storeEnabled, storeEnabled, storeWriteThrough, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, timeoutException, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, uncommit, 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, colocated, commitVersion, commitVersion, completedVersions, concurrency, currentPrepareFuture, done, endVersion, errorWhenCommitting, finishFuture, implicit, implicitSingle, 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, state, state, storeEnabled, storeWriteThrough, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, user, writeVersion, writeVersion, xid, xidVersion`

### Constructor Detail

#### GridDhtTxRemote

    public GridDhtTxRemote()

Empty constructor required for `Externalizable`.

#### GridDhtTxRemote

    public GridDhtTxRemote(GridCacheSharedContext ctx,
                   UUID nearNodeId,
                   IgniteUuid rmtFutId,
                   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)

This constructor is meant for optimistic transactions.

Parameters:
  `nearNodeId` - Near node ID.
  `rmtFutId` - Remote future 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.
  `ctx` - Cache context.
  `txSize` - Expected transaction size.
  `nearXidVer` - Near transaction ID.
  `txNodes` - Transaction nodes mapping.

#### GridDhtTxRemote

    public GridDhtTxRemote(GridCacheSharedContext ctx,
                   UUID nearNodeId,
                   IgniteUuid rmtFutId,
                   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)

This constructor is meant for pessimistic transactions.

Parameters:
  `nearNodeId` - Near node ID.
  `rmtFutId` - Remote future 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.
  `ctx` - Cache context.
  `txSize` - Expected transaction size.

### Method Detail

#### transactionNodes

    public void transactionNodes(Map<UUID,Collection<UUID>> txNodes)

Overrides:
  `transactionNodes` in class `IgniteTxAdapter`
Parameters:
  `txNodes` - Transaction nodes.

#### dht

    public boolean dht()

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

#### 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(GridCacheContext cacheCtx,
                           int part)

Specified by:
  `addInvalidPartition` in interface `IgniteInternalTx`
Overrides:
  `addInvalidPartition` in class `IgniteTxAdapter`
Parameters:
  `cacheCtx` - Cache context.
  `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
                CacheObject val,
                @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`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017