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

## Class GridDhtAtomicUpdateResponse<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.dht.atomic.GridDhtAtomicUpdateResponse<K,V>

All Implemented Interfaces:
  Serializable, GridCacheDeployable

    public class GridDhtAtomicUpdateResponse<K,V>
    extends GridCacheMessage<K,V>
    implements GridCacheDeployable

DHT atomic cache backup update response.

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
`static int` `CACHE_MSG_IDX` Message index.

### 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
`GridDhtAtomicUpdateResponse()` Empty constructor required by `Externalizable`.
`GridDhtAtomicUpdateResponse(int cacheId, GridCacheVersion futVer)`

### Method Summary

Methods
`void` `addFailedKey(K key, Throwable e)` Adds key to collection of failed keys.
`void` `addNearEvicted(K key, byte[] bytes)` Adds near evicted key..
`byte` `directType()` Gets message type.
`IgniteCheckedException` `error()`
`Collection<K>` `failedKeys()`
`void` `finishUnmarshal(GridCacheSharedContext<K,V> 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.
`Collection<K>` `nearEvicted()`
`void` `prepareMarshal(GridCacheSharedContext<K,V> ctx)` This method is called before the whole message is serialized and is responsible for pre-marshalling state.
`boolean` `readFrom(ByteBuffer buf)` Reads this message from provided byte buffer.
`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

`allowForStartup, cacheId, cacheId, classError, deployInfo, ignoreClassErrors, marshalBooleanLinkedMap, marshalCollection, marshalFilter, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, marshalValuesCollection, messageId, nextIndexId, onClassError, prepare, prepareFilter, prepareObject, prepareObjects, topologyVersion, transactional, transferExpiryPolicy, 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`

### Field Detail

#### CACHE_MSG_IDX

    public static final int CACHE_MSG_IDX

Message index.

### Constructor Detail

#### GridDhtAtomicUpdateResponse

    public GridDhtAtomicUpdateResponse()

Empty constructor required by `Externalizable`.

#### GridDhtAtomicUpdateResponse

    public GridDhtAtomicUpdateResponse(int cacheId,
                               GridCacheVersion futVer)

Parameters:
  `cacheId` - Cache ID.
  `futVer` - Future version.

### 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<K,V>`
Returns:
  Message lookup index.

#### futureVersion

    public GridCacheVersion futureVersion()

Returns:
  Future version.

#### error

    public IgniteCheckedException error()

Returns:
  Gets update error.

#### failedKeys

    public Collection<K> failedKeys()

Returns:
  Failed keys.

#### addFailedKey

    public void addFailedKey(K key,
                    Throwable e)

Adds key to collection of failed keys.

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

#### nearEvicted

    public Collection<K> nearEvicted()

Returns:
  Evicted readers.

#### addNearEvicted

    public void addNearEvicted(K key,
                      @Nullable
                      byte[] bytes)

Adds near evicted key..

Parameters:
  `key` - Evicted key.
  `bytes` - Bytes of evicted key.

#### prepareMarshal

    public void prepareMarshal(GridCacheSharedContext<K,V> 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<K,V>`
Parameters:
  `ctx` -
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

    public void finishUnmarshal(GridCacheSharedContext<K,V> 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<K,V>`
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.

Overrides:
  `writeTo` in class `GridCacheMessage<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 `GridCacheMessage<K,V>`
Parameters:
  `buf` - Byte buffer.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in class `MessageAdapter`
Returns:
  Message type.

#### toString

    public String toString()

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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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