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

## Class GridNearTxRemote

- 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.near.GridNearTxRemote

All Implemented Interfaces:
  Externalizable, Serializable, IgniteInternalTx, IgniteTxRemoteEx

    public class GridNearTxRemote
    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, consistentIdMapper, 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
`GridNearTxRemote()` Empty constructor required for `Externalizable`.

`GridNearTxRemote(GridCacheSharedContext ctx, AffinityTopologyVersion topVer, ClassLoader ldr, UUID nodeId, UUID nearNodeId, GridCacheVersion xidVer, GridCacheVersion commitVer, boolean sys, byte plc, TransactionConcurrency concurrency, TransactionIsolation isolation, boolean invalidate, long timeout, Collection<IgniteTxEntry> writeEntries, int txSize, UUID subjId, int taskNameHash)`
This constructor is meant for optimistic transactions.

`GridNearTxRemote(GridCacheSharedContext ctx, AffinityTopologyVersion topVer, UUID nodeId, UUID nearNodeId, GridCacheVersion nearXidVer, 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

All Methods Instance Methods Concrete Methods
`void` `addEntries(ClassLoader ldr, Iterable<IgniteTxEntry> entries)` Adds entries to started near remote tx.
`boolean` `addEntry(GridCacheContext cacheCtx, IgniteTxKey key, GridCacheOperation op, CacheObject val, GridCacheVersion drVer, boolean skipStore, boolean keepBinary)`
`UUID` `eventNodeId()`
`Collection<IgniteTxKey>` `evicted()`
`Collection<UUID>` `masterNodeIds()`
`boolean` `near()`
`UUID` `nearNodeId()`
`GridCacheVersion` `nearXidVersion()`
`GridCacheVersion` `ownedVersion(IgniteTxKey key)` Gets owned version for near remote transaction.
`void` `ownedVersions(Map<IgniteTxKey,GridCacheVersion> vers)` Adds owned versions to map.
`boolean` `remote()`
`void` `setPartitionUpdateCounters(long[] cntrs)`
`String` `toString()`

### 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, skipCompletedVersions, skipCompletedVersions, txState, writeEntries, writeMap, writeSet`

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

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

`addInvalidPartition, addMeta, colocated, commitVersion, commitVersion, completedVersions, concurrency, currentPrepareFuture, dht, done, endVersion, errorWhenCommitting, finishFuture, implicit, implicitSingle, internal, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, local, localResult, markFinalizing, meta, needsCompletedVersions, nodeId, onePhaseCommit, optimistic, optimisticLockEntries, otherNodeId, 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

#### GridNearTxRemote

    public GridNearTxRemote()

Empty constructor required for `Externalizable`.

#### GridNearTxRemote

    public GridNearTxRemote(GridCacheSharedContext ctx,
                            AffinityTopologyVersion topVer,
                            ClassLoader ldr,
                            UUID nodeId,
                            UUID nearNodeId,
                            GridCacheVersion xidVer,
                            GridCacheVersion commitVer,
                            boolean sys,
                            byte plc,
                            TransactionConcurrency concurrency,
                            TransactionIsolation isolation,
                            boolean invalidate,
                            long timeout,
                            Collection<IgniteTxEntry> writeEntries,
                            int txSize,
                            @Nullable
                            UUID subjId,
                            int taskNameHash)
                     throws IgniteCheckedException

This constructor is meant for optimistic transactions.

Parameters:
  `topVer` - Transaction topology version.
  `ldr` - Class loader.
  `nodeId` - Node ID.
  `nearNodeId` - Near node ID.
  `xidVer` - XID version.
  `commitVer` - Commit version.
  `sys` - System flag.
  `plc` - IO policy.
  `concurrency` - Concurrency level (should be pessimistic).
  `isolation` - Transaction isolation.
  `invalidate` - Invalidate flag.
  `timeout` - Timeout.
  `writeEntries` - Write entries.
  `ctx` - Cache registry.
  `txSize` - Expected transaction size.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash code.
Throws:
  `IgniteCheckedException` - If unmarshalling failed.

#### GridNearTxRemote

    public GridNearTxRemote(GridCacheSharedContext ctx,
                            AffinityTopologyVersion topVer,
                            UUID nodeId,
                            UUID nearNodeId,
                            GridCacheVersion nearXidVer,
                            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:
  `topVer` - Transaction topology version.
  `nodeId` - Node ID.
  `nearNodeId` - Near node ID.
  `nearXidVer` - Near transaction ID.
  `xidVer` - XID version.
  `commitVer` - Commit version.
  `sys` - System flag.
  `plc` - IO policy.
  `concurrency` - Concurrency level (should be pessimistic).
  `isolation` - Transaction isolation.
  `invalidate` - Invalidate flag.
  `timeout` - Timeout.
  `ctx` - Cache registry.
  `txSize` - Expected transaction size.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash code.

### Method Detail

#### remote

    public boolean remote()

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

#### near

    public boolean near()

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

#### eventNodeId

    public UUID eventNodeId()

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

#### ownedVersion

    public GridCacheVersion ownedVersion(IgniteTxKey key)

Gets owned version for near remote transaction.

Specified by:
  `ownedVersion` in interface `IgniteInternalTx`
Overrides:
  `ownedVersion` in class `IgniteTxAdapter`
Parameters:
  `key` - Key to get version for.
Returns:
  Owned version, if any.

#### nearXidVersion

    public GridCacheVersion nearXidVersion()

Description copied from class: `IgniteTxAdapter`

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

#### setPartitionUpdateCounters

    public void setPartitionUpdateCounters(long[] cntrs)

Description copied from class: `GridDistributedTxRemoteAdapter`

Specified by:
  `setPartitionUpdateCounters` in interface `IgniteTxRemoteEx`
Overrides:
  `setPartitionUpdateCounters` in class `GridDistributedTxRemoteAdapter`
Parameters:
  `cntrs` - Partition indexes.

#### ownedVersions

    public void ownedVersions(Map<IgniteTxKey,GridCacheVersion> vers)

Adds owned versions to map.

Parameters:
  `vers` - Map of owned versions.

#### nearNodeId

    public UUID nearNodeId()

Returns:
  Near node ID.

#### masterNodeIds

    public Collection<UUID> masterNodeIds()

Returns:
  Master node IDs.

#### evicted

    public Collection<IgniteTxKey> evicted()

Returns:
  Evicted keys.

#### addEntries

    public void addEntries(ClassLoader ldr,
                           Iterable<IgniteTxEntry> entries)
                    throws IgniteCheckedException

Adds entries to started near remote tx.

Parameters:
  `ldr` - Class loader.
  `entries` - Entries to add.
Throws:
  `IgniteCheckedException` - If failed.

#### addEntry

    public boolean addEntry(GridCacheContext cacheCtx,
                            IgniteTxKey key,
                            GridCacheOperation op,
                            CacheObject val,
                            @Nullable
                            GridCacheVersion drVer,
                            boolean skipStore,
                            boolean keepBinary)
                     throws IgniteCheckedException

Parameters:
  `cacheCtx` - Cache context.
  `key` - Key to add to read set.
  `op` - Operation.
  `val` - Value.
  `drVer` - Data center replication version.
  `skipStore` - Skip store flag.
Returns:
  `True` if entry has been enlisted.
Throws:
  `IgniteCheckedException` - If failed.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedTxRemoteAdapter`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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