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

## Class GridDhtAtomicUpdateRequest

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

All Implemented Interfaces:
  Serializable, GridCacheDeployable, Message

    public class GridDhtAtomicUpdateRequest
    extends GridCacheMessage
    implements GridCacheDeployable

Lite dht cache backup update request.

See Also:
  Serialized Form

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

### Constructor Summary

Constructors
Constructor and Description
`GridDhtAtomicUpdateRequest()` Empty constructor required by `Externalizable`.
`GridDhtAtomicUpdateRequest(int cacheId, UUID nodeId, GridCacheVersion futVer, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, long topVer, boolean forceTransformBackups, UUID subjId, int taskNameHash, Object[] invokeArgs)` Constructor.

### Method Summary

Methods
`void` `addNearWriteValue(KeyCacheObject key, CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long expireTime)`
`void` `addWriteValue(KeyCacheObject key, CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long conflictExpireTime, GridCacheVersion conflictVer)`
`long` `conflictExpireTime(int idx)`
`GridCacheVersion` `conflictVersion(int idx)`
`byte` `directType()` Gets message type.
`javax.cache.processor.EntryProcessor<Object,Object,Object>` `entryProcessor(int idx)`
`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.
`boolean` `forceTransformBackups()`
`GridCacheVersion` `futureVersion()`
`Object[]` `invokeArguments()`
`KeyCacheObject` `key(int idx)`
`Collection<KeyCacheObject>` `keys()`
`int` `lookupIndex()` Gets message lookup index.
`javax.cache.processor.EntryProcessor<Object,Object,Object>` `nearEntryProcessor(int idx)`
`long` `nearExpireTime(int idx)`
`KeyCacheObject` `nearKey(int idx)`
`int` `nearSize()`
`long` `nearTtl(int idx)`
`CacheObject` `nearValue(int idx)`
`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.
`int` `size()`
`UUID` `subjectId()`
`int` `taskNameHash()`
`long` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`String` `toString()`
`long` `ttl(int idx)`
`CacheObject` `value(int idx)`
`CacheWriteSynchronizationMode` `writeSynchronizationMode()`
`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.GridCacheMessage

`allowForStartup, cacheId, cacheId, classError, deployInfo, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, marshalBooleanLinkedMap, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onClassError, prepare, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, transferExpiryPolicy, unmarshalBooleanLinkedMap, 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

Message index.

### Constructor Detail

#### GridDhtAtomicUpdateRequest

    public GridDhtAtomicUpdateRequest()

Empty constructor required by `Externalizable`.

#### GridDhtAtomicUpdateRequest

    public GridDhtAtomicUpdateRequest(int cacheId,
                              UUID nodeId,
                              GridCacheVersion futVer,
                              GridCacheVersion writeVer,
                              CacheWriteSynchronizationMode syncMode,
                              long topVer,
                              boolean forceTransformBackups,
                              UUID subjId,
                              int taskNameHash,
                              Object[] invokeArgs)

Constructor.

Parameters:
  `cacheId` - Cache ID.
  `nodeId` - Node ID.
  `futVer` - Future version.
  `writeVer` - Write version for cache values.
  `invokeArgs` - Optional arguments for entry processor.
  `syncMode` - Cache write synchronization mode.
  `topVer` - Topology version.
  `forceTransformBackups` - Force transform backups flag.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash code.

### Method Detail

#### forceTransformBackups

    public boolean forceTransformBackups()

Returns:
  Force transform backups flag.

#### addWriteValue

    public void addWriteValue(KeyCacheObject key,
                     @Nullable
                     CacheObject val,
                     javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                     long ttl,
                     long conflictExpireTime,
                     @Nullable
                     GridCacheVersion conflictVer)

Parameters:
  `key` - Key to add.
  `val` - Value, `null` if should be removed.
  `entryProcessor` - Entry processor.
  `ttl` - TTL (optional).
  `conflictExpireTime` - Conflict expire time (optional).
  `conflictVer` - Conflict version (optional).

#### addNearWriteValue

    public void addNearWriteValue(KeyCacheObject key,
                         @Nullable
                         CacheObject val,
                         javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                         long ttl,
                         long expireTime)

Parameters:
  `key` - Key to add.
  `val` - Value, `null` if should be removed.
  `entryProcessor` - Entry processor.
  `ttl` - TTL.
  `expireTime` - Expire time.

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

#### subjectId

    public UUID subjectId()

Returns:
  Subject ID.

#### taskNameHash

    public int taskNameHash()

Returns:
  Task name.

#### size

    public int size()

Returns:
  Keys size.

#### nearSize

    public int nearSize()

Returns:
  Keys size.

#### futureVersion

    public GridCacheVersion futureVersion()

Returns:
  Version assigned on primary node.

#### writeVersion

    public GridCacheVersion writeVersion()

Returns:
  Write version.

#### writeSynchronizationMode

    public CacheWriteSynchronizationMode writeSynchronizationMode()

Returns:
  Cache write synchronization mode.

#### 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`
Returns:
  Topology version.

#### keys

    public Collection<KeyCacheObject> keys()

Returns:
  Keys.

#### key

    public KeyCacheObject key(int idx)

Parameters:
  `idx` - Key index.
Returns:
  Key.

#### nearKey

    public KeyCacheObject nearKey(int idx)

Parameters:
  `idx` - Near key index.
Returns:
  Key.

#### value

    @Nullable
    public CacheObject value(int idx)

Parameters:
  `idx` - Key index.
Returns:
  Value.

#### entryProcessor

    @Nullable
    public javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor(int idx)

Parameters:
  `idx` - Key index.
Returns:
  Entry processor.

#### nearValue

    @Nullable
    public CacheObject nearValue(int idx)

Parameters:
  `idx` - Near key index.
Returns:
  Value.

#### nearEntryProcessor

    @Nullable
    public javax.cache.processor.EntryProcessor<Object,Object,Object> nearEntryProcessor(int idx)

Parameters:
  `idx` - Key index.
Returns:
  Transform closure.

#### conflictVersion

    @Nullable
    public GridCacheVersion conflictVersion(int idx)

Parameters:
  `idx` - Index.
Returns:
  Conflict version.

#### ttl

    public long ttl(int idx)

Parameters:
  `idx` - Index.
Returns:
  TTL.

#### nearTtl

    public long nearTtl(int idx)

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

#### conflictExpireTime

    public long conflictExpireTime(int idx)

Parameters:
  `idx` - Index.
Returns:
  Conflict expire time.

#### nearExpireTime

    public long nearExpireTime(int idx)

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

#### invokeArguments

    @Nullable
    public Object[] invokeArguments()

Returns:
  Optional arguments for entry processor.

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

#### 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.0.0-RC3
Release Date | : March 24 2015