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

## Class GridNearTxPrepareResponse

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.GridCacheIdMessage
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
      - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxPrepareResponse
        - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareResponse

All Implemented Interfaces:
  Serializable, GridCacheDeployable, IgniteTxStateAware, GridCacheVersionable, Message

    public class GridNearTxPrepareResponse
    extends GridDistributedTxPrepareResponse

Near cache prepare response.

See Also:
  Serialized Form

### Field Summary

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

`flags`

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

`ver`

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

`cacheId`

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

`addDepInfo, CACHE_MSG_INDEX_FIELD_NAME, forceAddDepInfo, MAX_CACHE_MSG_LOOKUP_INDEX`

### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`DIRECT_TYPE_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`GridNearTxPrepareResponse()` Empty constructor required by `Externalizable`.
`GridNearTxPrepareResponse(int part, GridCacheVersion xid, IgniteUuid futId, int miniId, GridCacheVersion dhtVer, GridCacheVersion writeVer, GridCacheReturn retVal, Throwable err, AffinityTopologyVersion clientRemapVer, boolean onePhaseCommit, boolean addDepInfo)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addOwnedValue(IgniteTxKey key, GridCacheVersion ver, CacheObject val)` Adds owned value.
`GridCacheVersion` `dhtVersion()`
`short` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`Collection<IgniteTxKey>` `filterFailedKeys()`
`void` `filterFailedKeys(Collection<IgniteTxKey> filterFailedKeys)`
`void` `finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)` This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.
`IgniteUuid` `futureId()`
`boolean` `hasOwnedValue(IgniteTxKey key)`
`int` `miniId()`
`boolean` `onePhaseCommit()`
`Map<IgniteTxKey,CacheVersionedValue>` `ownedValues()`
`Collection<GridCacheVersion>` `pending()` Gets pending versions that are less than `GridDistributedBaseMessage.version()`.
`void` `pending(Collection<GridCacheVersion> pending)` Sets pending versions that are less than `GridDistributedBaseMessage.version()`.
`void` `prepareMarshal(GridCacheSharedContext ctx)` This method is called before the whole message is serialized and is responsible for pre-marshalling state.
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`GridCacheReturn` `returnValue()`
`String` `toString()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.
`GridCacheVersion` `writeVersion()`

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

`error, error, isFlag, isRollback, messageLogger, partition, setFlag, txState, txState`

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

`addDeploymentInfo, committedVersions, completedVersions, rolledbackVersions, version, version`

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

`cacheGroupMessage, cacheId, cacheId, handlerId`

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

`appendFlag, classError, deployInfo, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onAckReceived, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, prepareObject, topologyVersion, transferExpiryPolicy, unmarshalCollection, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx`

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

#### GridNearTxPrepareResponse

    public GridNearTxPrepareResponse()

Empty constructor required by `Externalizable`.

#### GridNearTxPrepareResponse

    public GridNearTxPrepareResponse(int part,
                                     GridCacheVersion xid,
                                     IgniteUuid futId,
                                     int miniId,
                                     GridCacheVersion dhtVer,
                                     GridCacheVersion writeVer,
                                     GridCacheReturn retVal,
                                     Throwable err,
                                     AffinityTopologyVersion clientRemapVer,
                                     boolean onePhaseCommit,
                                     boolean addDepInfo)

Parameters:
  `part` - Partition.
  `xid` - Xid version.
  `futId` - Future ID.
  `miniId` - Mini future ID.
  `dhtVer` - DHT version.
  `writeVer` - Write version.
  `retVal` - Return value.
  `err` - Error.
  `clientRemapVer` - Not `null` if client node should remap transaction.
  `addDepInfo` - Deployment info flag.

### Method Detail

#### onePhaseCommit

    public boolean onePhaseCommit()

Returns:
  One-phase commit state on primary node.

#### pending

    public Collection<GridCacheVersion> pending()

Gets pending versions that are less than `GridDistributedBaseMessage.version()`.

Returns:
  Pending versions.

#### pending

    public void pending(Collection<GridCacheVersion> pending)

Sets pending versions that are less than `GridDistributedBaseMessage.version()`.

Parameters:
  `pending` - Pending versions.

#### miniId

    public int miniId()

Returns:
  Mini future ID.

#### futureId

    public IgniteUuid futureId()

Returns:
  Future ID.

#### dhtVersion

    public GridCacheVersion dhtVersion()

Returns:
  DHT version.

#### writeVersion

    public GridCacheVersion writeVersion()

Returns:
  Write version.

#### addOwnedValue

    public void addOwnedValue(IgniteTxKey key,
                              GridCacheVersion ver,
                              CacheObject val)

Adds owned value.

Parameters:
  `key` - Key.
  `ver` - DHT version.
  `val` - Value.

#### ownedValues

    public Map<IgniteTxKey,CacheVersionedValue> ownedValues()

Returns:
  Owned values map.

#### returnValue

    public GridCacheReturn returnValue()

Returns:
  Return value.

#### filterFailedKeys

    public void filterFailedKeys(Collection<IgniteTxKey> filterFailedKeys)

Parameters:
  `filterFailedKeys` - Collection of keys that did not pass the filter.

#### filterFailedKeys

    public Collection<IgniteTxKey> filterFailedKeys()

Returns:
  Collection of keys that did not pass the filter.

#### hasOwnedValue

    public boolean hasOwnedValue(IgniteTxKey key)

Parameters:
  `key` - Key.
Returns:
  `True` if response has owned value for given key.

#### prepareMarshal

    public void prepareMarshal(GridCacheSharedContext ctx)
                        throws IgniteCheckedException

This method is called before the whole message is serialized and is responsible for pre-marshalling state.

Overrides:
  `prepareMarshal` in class `GridDistributedTxPrepareResponse`
Parameters:
  `ctx` -
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

    public void finishUnmarshal(GridCacheSharedContext ctx,
                                ClassLoader ldr)
                         throws IgniteCheckedException

This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.

Overrides:
  `finishUnmarshal` in class `GridDistributedTxPrepareResponse`
Parameters:
  `ctx` - Context.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                           MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Overrides:
  `writeTo` in class `GridDistributedTxPrepareResponse`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                            MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Overrides:
  `readFrom` in class `GridDistributedTxPrepareResponse`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public short directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Overrides:
  `directType` in class `GridDistributedTxPrepareResponse`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Overrides:
  `fieldsCount` in class `GridDistributedTxPrepareResponse`
Returns:
  Fields count.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedTxPrepareResponse`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023