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, AutoCloseable, IgniteInternalTx, IgniteTxRemoteEx, GridTimeoutObject

    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

`readMap, writeMap`

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

`cctx, concurrency, endVer, implicit, implicitSingle, internal, invalidate, isDone, isolation, loc, log, nodeId, onePhaseCommit, startTime, startVer, storeEnabled, subjId, syncCommit, syncRollback, taskName, taskNameHash, threadId, timeout, topVer, transform, txNodes, txSize, writeVer, xidVer`

### Constructor Summary

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

`GridNearTxRemote(GridCacheSharedContext ctx, ClassLoader ldr, UUID nodeId, UUID nearNodeId, long rmtThreadId, 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, UUID nodeId, UUID nearNodeId, GridCacheVersion nearXidVer, long rmtThreadId, 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` `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)`
`void` `addEvicted(IgniteTxKey key)` Adds evicted key bytes to evicted collection.
`boolean` `enforceSerializable()` For Partitioned caches, this flag is `false` for remote DHT and remote NEAR transactions because serializability of transaction is enforced on primary node.
`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.
`String` `toString()`

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

`activeCacheIds, addExplicit, allEntries, alternateVersions, clearEntry, commit, commitAsync, doneRemote, empty, entry, forceCommit, hasWriteKey, invalidate, isStarted, onOwnerChanged, originatingNodeId, peek, prepare, prepareAsync, readEntries, readMap, readSet, remoteThreadId, removed, rollback, rollbackAsync, seal, setWriteValue, writeEntries, writeMap, writeSet`

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

`addInvalidPartition, applyTransformClosures, awaitCompletion, awaitSignal, checkInternal, close, colocated, commitVersion, commitVersion, completedVersions, concurrency, conflictResolve, currentPrepareFuture, dht, done, endTime, endVersion, endVersion, equals, evictNearEntry, finalizationStatus, finishFuture, hashCode, hasTransforms, implicit, implicitSingle, initCommitVersion, internal, invalidPartitions, ioPolicy, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, local, localResult, lock, lockTimeout, log, markFinalizing, markPreparing, needsCompletedVersions, nodeId, onePhaseCommit, onePhaseCommit, onRemap, onTimeout, optimistic, optimisticLockEntries, otherNodeId, ownsLock, ownsLockUnsafe, pessimistic, proxy, readCommitted, readExternal, readResolve, remainingTime, repeatableRead, replicated, resolveTaskName, serializable, setRollbackOnly, signalAll, size, startTime, startVersion, state, state, storeEnabled, storeEnabled, stores, storeUsed, subjectId, syncCommit, syncCommit, syncRollback, syncRollback, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, timeoutId, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, transactionNodes, uncommit, unlock, 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, close, colocated, commitVersion, commitVersion, completedVersions, concurrency, currentPrepareFuture, dht, done, endVersion, endVersion, finishFuture, hasTransforms, implicit, implicitSingle, internal, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, local, localResult, markFinalizing, markPreparing, meta, needsCompletedVersions, nodeId, onePhaseCommit, onRemap, optimistic, optimisticLockEntries, otherNodeId, ownsLock, ownsLockUnsafe, pessimistic, proxy, readCommitted, remainingTime, removeMeta, repeatableRead, replicated, serializable, setRollbackOnly, size, startTime, startVersion, state, state, storeEnabled, storeUsed, subjectId, syncCommit, syncRollback, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, user, writeVersion, writeVersion, xid, xidVersion`

### Methods inherited from interface org.apache.ignite.internal.processors.timeout.GridTimeoutObject

`endTime, onTimeout, timeoutId`

### Constructor Detail

#### GridNearTxRemote

    public GridNearTxRemote()

Empty constructor required for `Externalizable`.

#### GridNearTxRemote

    public GridNearTxRemote(GridCacheSharedContext ctx,
                    ClassLoader ldr,
                    UUID nodeId,
                    UUID nearNodeId,
                    long rmtThreadId,
                    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:
  `ldr` - Class loader.
  `nodeId` - Node ID.
  `nearNodeId` - Near node ID.
  `rmtThreadId` - Remote thread ID.
  `xidVer` - XID version.
  `commitVer` - Commit version.
  `sys` - System flag.
  `concurrency` - Concurrency level (should be pessimistic).
  `isolation` - Transaction isolation.
  `invalidate` - Invalidate flag.
  `timeout` - Timeout.
  `writeEntries` - Write entries.
  `ctx` - Cache registry.
  `txSize` - Expected transaction size.
Throws:
  `IgniteCheckedException` - If unmarshalling failed.

#### GridNearTxRemote

    public GridNearTxRemote(GridCacheSharedContext ctx,
                    UUID nodeId,
                    UUID nearNodeId,
                    GridCacheVersion nearXidVer,
                    long rmtThreadId,
                    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:
  `nodeId` - Node ID.
  `nearNodeId` - Near node ID.
  `nearXidVer` - Near transaction ID.
  `rmtThreadId` - Remote thread ID.
  `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 registry.
  `txSize` - Expected transaction size.

### Method Detail

#### 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.

#### enforceSerializable

    public boolean enforceSerializable()

For Partitioned caches, this flag is `false` for remote DHT and remote NEAR transactions because serializability of transaction is enforced on primary node. All other transaction types must enforce it.

Specified by:
  `enforceSerializable` in interface `IgniteInternalTx`
Overrides:
  `enforceSerializable` in class `IgniteTxAdapter`
Returns:
  Enforce serializable flag.

#### 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.

#### 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()

Specified by:
  `masterNodeIds` in interface `IgniteInternalTx`
Overrides:
  `masterNodeIds` in class `GridDistributedTxRemoteAdapter`
Returns:
  Master node IDs.

#### evicted

    public Collection<IgniteTxKey> evicted()

Returns:
  Evicted keys.

#### addEvicted

    public void addEvicted(IgniteTxKey key)

Adds evicted key bytes to evicted collection.

Parameters:
  `key` - Evicted key.

#### 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)
                     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`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015