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

## Class GridDistributedTxMapping

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping

All Implemented Interfaces:
  Externalizable, Serializable

    public class GridDistributedTxMapping
    extends Object
    implements Externalizable

Transaction node mapping.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridDistributedTxMapping()` Empty constructor required for `Externalizable`.
`GridDistributedTxMapping(ClusterNode node)`

### Method Summary

Methods
`void` `add(IgniteTxEntry entry)`
`boolean` `clientFirst()`
`void` `clientFirst(boolean clientFirst)`
`GridCacheVersion` `dhtVersion()`
`void` `dhtVersion(GridCacheVersion dhtVer, GridCacheVersion writeVer)`
`boolean` `empty()` Whether empty or not.
`Collection<IgniteTxEntry>` `entries()`
`void` `entries(Collection<IgniteTxEntry> entries, boolean readOnly)`
`void` `evictPartitions(int[] parts)`
`void` `evictReaders(Collection<IgniteTxKey> keys)`
`boolean` `explicitLock()`
`boolean` `last()`
`void` `last(boolean last)`
`Collection<UUID>` `lastBackups()`
`void` `lastBackups(Collection<UUID> lastBackups)`
`void` `markExplicitLock()` Sets explicit flag to `true`.
`boolean` `near()`
`void` `near(boolean near)`
`ClusterNode` `node()`
`void` `readExternal(ObjectInput in)`
`Collection<IgniteTxEntry>` `reads()`
`boolean` `removeEntry(IgniteTxEntry entry)`
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`
`Collection<IgniteTxEntry>` `writes()`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridDistributedTxMapping

    public GridDistributedTxMapping()

Empty constructor required for `Externalizable`.

#### GridDistributedTxMapping

    public GridDistributedTxMapping(ClusterNode node)

Parameters:
  `node` - Mapped node.

### Method Detail

#### lastBackups

    @Nullable
    public Collection<UUID> lastBackups()

Returns:
  IDs of backup nodes receiving last prepare request during this mapping.

#### lastBackups

    public void lastBackups(@Nullable
                   Collection<UUID> lastBackups)

Parameters:
  `lastBackups` - IDs of backup nodes receiving last prepare request during this mapping.

#### last

    public boolean last()

Returns:
  `True` if this is last mapping for node.

#### last

    public void last(boolean last)

Parameters:
  `last` - If `True` this is last mapping for node.

#### clientFirst

    public boolean clientFirst()

Returns:
  `True` if this is first mapping for optimistic tx on client node.

#### clientFirst

    public void clientFirst(boolean clientFirst)

Parameters:
  `clientFirst` - `True` if this is first mapping for optimistic tx on client node.

#### near

    public boolean near()

Returns:
  `True` if mapping is for near caches, `false` otherwise.

#### near

    public void near(boolean near)

Parameters:
  `near` - `True` if mapping is for near caches, `false` otherwise.

#### node

    public ClusterNode node()

Returns:
  Node.

#### entries

    public Collection<IgniteTxEntry> entries()

Returns:
  Entries.

#### entries

    public void entries(Collection<IgniteTxEntry> entries,
               boolean readOnly)

Parameters:
  `entries` - Mapped entries.
  `readOnly` - Flag indicating that passed in collection is read-only.

#### explicitLock

    public boolean explicitLock()

Returns:
  `True` if lock is explicit.

#### markExplicitLock

    public void markExplicitLock()

Sets explicit flag to `true`.

#### dhtVersion

    public GridCacheVersion dhtVersion()

Returns:
  DHT version.

#### dhtVersion

    public void dhtVersion(GridCacheVersion dhtVer,
                  GridCacheVersion writeVer)

Parameters:
  `dhtVer` - DHT version.
  `writeVer` - DHT writeVersion.

#### reads

    public Collection<IgniteTxEntry> reads()

Returns:
  Reads.

#### writes

    public Collection<IgniteTxEntry> writes()

Returns:
  Writes.

#### add

    public void add(IgniteTxEntry entry)

Parameters:
  `entry` - Adds entry.

#### removeEntry

    public boolean removeEntry(IgniteTxEntry entry)

Parameters:
  `entry` - Entry to remove.
Returns:
  `True` if entry was removed.

#### evictPartitions

    public void evictPartitions(@Nullable
                       int[] parts)

Parameters:
  `parts` - Evicts partitions from mapping.

#### evictReaders

    public void evictReaders(@Nullable
                    Collection<IgniteTxKey> keys)

Parameters:
  `keys` - Keys to evict readers for.

#### empty

    public boolean empty()

Whether empty or not.

Returns:
  Empty or not.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.2.0-incubating
Release Date | : June 16 2015