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

## Class GridNearTxPrepareRequest<K,V>

- java.lang.Object
- - org.apache.ignite.plugin.extensions.communication.MessageAdapter
  - - org.apache.ignite.internal.processors.cache.GridCacheMessage<K,V>
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage<K,V>
      - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxPrepareRequest<K,V>
        - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareRequest<K,V>

All Implemented Interfaces:
  Serializable, GridCacheDeployable, GridCacheVersionable

    public class GridNearTxPrepareRequest<K,V>
    extends GridDistributedTxPrepareRequest<K,V>

Near transaction prepare request.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`MessageAdapter.Type`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage

`ver`

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

`CACHE_MSG_INDEX_FIELD_NAME, cacheId, MAX_CACHE_MSG_LOOKUP_INDEX`

### Fields inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`reader, readState`

### Constructor Summary

Constructors
Constructor and Description
`GridNearTxPrepareRequest()` Empty constructor required for `Externalizable`.
`GridNearTxPrepareRequest(IgniteUuid futId, long topVer, IgniteInternalTx<K,V> tx, Collection<IgniteTxEntry<K,V>> reads, Collection<IgniteTxEntry<K,V>> writes, IgniteTxKey grpLockKey, boolean partLock, boolean near, Map<UUID,Collection<UUID>> txNodes, boolean last, Collection<UUID> lastBackups, boolean onePhaseCommit, boolean retVal, boolean implicitSingle, UUID subjId, int taskNameHash)`

### Method Summary

Methods
`void` `cloneEntries()`
`byte` `directType()` Gets message type.
`IgniteUuid` `futureId()`
`boolean` `implicitSingle()`
`boolean` `last()`
`Collection<UUID>` `lastBackups()`
`IgniteUuid` `miniId()`
`void` `miniId(IgniteUuid miniId)`
`boolean` `near()`
`boolean` `readFrom(ByteBuffer buf)` Reads this message from provided byte buffer.
`boolean` `returnValue()`
`UUID` `subjectId()`
`int` `taskNameHash()`
`long` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`String` `toString()`
`protected boolean` `transferExpiryPolicy()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

`addDhtVersion, concurrency, dhtVersions, finishUnmarshal, groupLockKey, isInvalidate, isolation, onePhaseCommit, partitionLock, prepareMarshal, reads, reads, system, threadId, timeout, transactionNodes, txSize, writes, writes, writeVersion`

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

`candidatesByIndex, candidatesByIndex, candidatesByKey, candidatesByKey, candidatesByKey, committedVersions, completedVersions, keysCount, rolledbackVersions, version, version`

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

`allowForStartup, cacheId, cacheId, classError, deployInfo, ignoreClassErrors, lookupIndex, marshalBooleanLinkedMap, marshalCollection, marshalFilter, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, marshalValuesCollection, messageId, nextIndexId, onClassError, prepare, prepareFilter, prepareObject, prepareObjects, transactional, unmarshalBooleanLinkedMap, unmarshalCollection, unmarshalFilter, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx, unmarshalValueBytesCollection`

### Methods inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`setReader, skipRecovery`

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

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

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheDeployable

`deployInfo, prepare`

### Constructor Detail

#### GridNearTxPrepareRequest

    public GridNearTxPrepareRequest()

Empty constructor required for `Externalizable`.

#### GridNearTxPrepareRequest

    public GridNearTxPrepareRequest(IgniteUuid futId,
                            long topVer,
                            IgniteInternalTx<K,V> tx,
                            Collection<IgniteTxEntry<K,V>> reads,
                            Collection<IgniteTxEntry<K,V>> writes,
                            IgniteTxKey grpLockKey,
                            boolean partLock,
                            boolean near,
                            Map<UUID,Collection<UUID>> txNodes,
                            boolean last,
                            Collection<UUID> lastBackups,
                            boolean onePhaseCommit,
                            boolean retVal,
                            boolean implicitSingle,
                            @Nullable
                            UUID subjId,
                            int taskNameHash)

Parameters:
  `futId` - Future ID.
  `topVer` - Topology version.
  `tx` - Transaction.
  `reads` - Read entries.
  `writes` - Write entries.
  `grpLockKey` - Group lock key if preparing group-lock transaction.
  `partLock` - `True` if preparing group-lock transaction with partition lock.
  `near` - `True` if mapping is for near caches.
  `txNodes` - Transaction nodes mapping.
  `last` - `True` if this last prepare request for node.
  `lastBackups` - IDs of backup nodes receiving last prepare request during this prepare.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash.

### Method Detail

#### lastBackups

    public Collection<UUID> lastBackups()

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

#### last

    public boolean last()

Returns:
  `True` if this last prepare request for node.

#### near

    public boolean near()

Returns:
  `True` if mapping is for near-enabled caches.

#### futureId

    public IgniteUuid futureId()

Returns:
  Future ID.

#### miniId

    public IgniteUuid miniId()

Returns:
  Mini future ID.

#### miniId

    public void miniId(IgniteUuid miniId)

Parameters:
  `miniId` - Mini future ID.

#### subjectId

    @Nullable
    public UUID subjectId()

Returns:
  Subject ID.

#### taskNameHash

    public int taskNameHash()

Returns:
  Task name hash.

#### returnValue

    public boolean returnValue()

Returns:
  Whether return value is requested.

#### implicitSingle

    public boolean implicitSingle()

Returns:
  Implicit single flag.

#### topologyVersion

    public long topologyVersion()

Description copied from class: `GridCacheMessage`
Gets topology version or -1 in case of topology version is not required for this message.

Overrides:
  `topologyVersion` in class `GridCacheMessage<K,V>`
Returns:
  Topology version.

#### cloneEntries

    public void cloneEntries()

#### transferExpiryPolicy

    protected boolean transferExpiryPolicy()

Overrides:
  `transferExpiryPolicy` in class `GridCacheMessage<K,V>`
Returns:
  `True` if entries expire policy should be marshalled.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Overrides:
  `writeTo` in class `GridDistributedTxPrepareRequest<K,V>`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf)

Reads this message from provided byte buffer.

Overrides:
  `readFrom` in class `GridDistributedTxPrepareRequest<K,V>`
Parameters:
  `buf` - Byte buffer.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Overrides:
  `directType` in class `GridDistributedTxPrepareRequest<K,V>`
Returns:
  Message type.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedTxPrepareRequest<K,V>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015