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

## Class GridNearAtomicUpdateResponse

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicUpdateResponse

All Implemented Interfaces:
  Serializable, GridCacheDeployable, Message

    public class GridNearAtomicUpdateResponse
    extends GridCacheMessage
    implements GridCacheDeployable

DHT atomic cache near update response.

See Also:
  Serialized Form

### Field Summary

Fields
`static int` `CACHE_MSG_IDX` Cache message index.

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

`addDepInfo, CACHE_MSG_INDEX_FIELD_NAME, cacheId, forceAddDepInfo, MAX_CACHE_MSG_LOOKUP_INDEX`

### Constructor Summary

Constructors
Constructor and Description
`GridNearAtomicUpdateResponse()` Empty constructor required by `Externalizable`.
`GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, GridCacheVersion futVer, boolean addDepInfo)`

### Method Summary

Methods
`boolean` `addDeploymentInfo()` Deployment enabled flag indicates whether deployment info has to be added to this message.
`void` `addFailedKey(KeyCacheObject key, Throwable e)` Adds key to collection of failed keys.
`void` `addFailedKeys(Collection<KeyCacheObject> keys, Throwable e)` Adds keys to collection of failed keys.
`void` `addFailedKeys(Collection<KeyCacheObject> keys, Throwable e, GridCacheContext ctx)` Adds keys to collection of failed keys.
`void` `addNearTtl(int keyIdx, long ttl, long expireTime)`
`void` `addNearValue(int keyIdx, CacheObject val, long ttl, long expireTime)` Adds value to be put in near cache on originating node.
`void` `addSkippedIndex(int keyIdx)`
`byte` `directType()` Gets message type.
`IgniteCheckedException` `error()`
`void` `error(IgniteCheckedException err)` Sets update error.
`Collection<KeyCacheObject>` `failedKeys()`
`byte` `fieldsCount()` Gets fields count.
`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.
`GridCacheVersion` `futureVersion()`
`int` `lookupIndex()` Gets message lookup index.
`long` `nearExpireTime(int idx)`
`long` `nearTtl(int idx)`
`CacheObject` `nearValue(int idx)`
`List<Integer>` `nearValuesIndexes()`
`GridCacheVersion` `nearVersion()`
`void` `nearVersion(GridCacheVersion nearVer)`
`UUID` `nodeId()`
`void` `nodeId(UUID nodeId)`
`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.
`Collection<KeyCacheObject>` `remapKeys()`
`void` `remapKeys(List<KeyCacheObject> remapKeys)`
`GridCacheReturn` `returnValue()`
`void` `returnValue(GridCacheReturn ret)`
`List<Integer>` `skippedIndexes()`
`String` `toString()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

`cacheId, cacheId, classError, deployInfo, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onAckReceived, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, 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`

### Field Detail

#### CACHE_MSG_IDX

    public static final int CACHE_MSG_IDX

Cache message index.

### Constructor Detail

#### GridNearAtomicUpdateResponse

    public GridNearAtomicUpdateResponse()

Empty constructor required by `Externalizable`.

#### GridNearAtomicUpdateResponse

    public GridNearAtomicUpdateResponse(int cacheId,
                                UUID nodeId,
                                GridCacheVersion futVer,
                                boolean addDepInfo)

Parameters:
  `cacheId` - Cache ID.
  `nodeId` - Node ID this reply should be sent to.
  `futVer` - Future version.
  `addDepInfo` - Deployment info flag.

### Method Detail

#### lookupIndex

    public int lookupIndex()

Gets message lookup index. All messages that does not return -1 in this method must return a unique number in range from 0 to `GridCacheMessage.MAX_CACHE_MSG_LOOKUP_INDEX`.

Overrides:
  `lookupIndex` in class `GridCacheMessage`
Returns:
  Message lookup index.

#### nodeId

    public UUID nodeId()

Returns:
  Node ID this response should be sent to.

#### nodeId

    public void nodeId(UUID nodeId)

Parameters:
  `nodeId` - Node ID.

#### futureVersion

    public GridCacheVersion futureVersion()

Returns:
  Future version.

#### error

    public void error(IgniteCheckedException err)

Sets update error.

Parameters:
  `err` - Error.

#### error

    public IgniteCheckedException error()

Overrides:
  `error` in class `GridCacheMessage`
Returns:
  Error, if any.

#### failedKeys

    public Collection<KeyCacheObject> failedKeys()

Returns:
  Collection of failed keys.

#### returnValue

    public GridCacheReturn returnValue()

Returns:
  Return value.

#### returnValue

    public void returnValue(GridCacheReturn ret)

Parameters:
  `ret` - Return value.

#### remapKeys

    public void remapKeys(List<KeyCacheObject> remapKeys)

Parameters:
  `remapKeys` - Remap keys.

#### remapKeys

    public Collection<KeyCacheObject> remapKeys()

Returns:
  Remap keys.

#### addNearValue

    public void addNearValue(int keyIdx,
                    @Nullable
                    CacheObject val,
                    long ttl,
                    long expireTime)

Adds value to be put in near cache on originating node.

Parameters:
  `keyIdx` - Key index.
  `val` - Value.
  `ttl` - TTL for near cache update.
  `expireTime` - Expire time for near cache update.

#### addNearTtl

    public void addNearTtl(int keyIdx,
                  long ttl,
                  long expireTime)

Parameters:
  `keyIdx` - Key index.
  `ttl` - TTL for near cache update.
  `expireTime` - Expire time for near cache update.

#### nearExpireTime

    public long nearExpireTime(int idx)

Parameters:
  `idx` - Index.
Returns:
  Expire time for near cache update.

#### nearTtl

    public long nearTtl(int idx)

Parameters:
  `idx` - Index.
Returns:
  TTL for near cache update.

#### nearVersion

    public void nearVersion(GridCacheVersion nearVer)

Parameters:
  `nearVer` - Version generated on primary node to be used for originating node's near cache update.

#### nearVersion

    public GridCacheVersion nearVersion()

Returns:
  Version generated on primary node to be used for originating node's near cache update.

#### addSkippedIndex

    public void addSkippedIndex(int keyIdx)

Parameters:
  `keyIdx` - Index of key for which update was skipped

#### skippedIndexes

    @Nullable
    public List<Integer> skippedIndexes()

Returns:
  Indexes of keys for which update was skipped

#### nearValuesIndexes

    @Nullable
    public List<Integer> nearValuesIndexes()

Returns:
  Indexes of keys for which values were generated on primary node.

#### nearValue

    @Nullable
    public CacheObject nearValue(int idx)

Parameters:
  `idx` - Index.
Returns:
  Value generated on primary node which should be put to originating node's near cache.

#### addFailedKey

    public void addFailedKey(KeyCacheObject key,
                    Throwable e)

Adds key to collection of failed keys.

Parameters:
  `key` - Key to add.
  `e` - Error cause.

#### addFailedKeys

    public void addFailedKeys(Collection<KeyCacheObject> keys,
                     Throwable e)

Adds keys to collection of failed keys.

Parameters:
  `keys` - Key to add.
  `e` - Error cause.

#### addFailedKeys

    public void addFailedKeys(Collection<KeyCacheObject> keys,
                     Throwable e,
                     GridCacheContext ctx)

Adds keys to collection of failed keys.

Parameters:
  `keys` - Key to add.
  `e` - Error cause.
  `ctx` - Context.

#### 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 `GridCacheMessage`
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 `GridCacheMessage`
Parameters:
  `ctx` - Context.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### addDeploymentInfo

    public boolean addDeploymentInfo()

Deployment enabled flag indicates whether deployment info has to be added to this message.

Specified by:
  `addDeploymentInfo` in class `GridCacheMessage`
Returns:
  `true` or if deployment info must be added to the the message, `false` otherwise.

#### 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 `GridCacheMessage`
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 `GridCacheMessage`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

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

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheMessage`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016