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

## Class GridDhtAtomicAbstractUpdateRequest

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

All Implemented Interfaces:
  Serializable, GridCacheDeployable, Message

Direct Known Subclasses:
  GridDhtAtomicSingleUpdateRequest, GridDhtAtomicUpdateRequest

    public abstract class GridDhtAtomicAbstractUpdateRequest
    extends GridCacheIdMessage
    implements GridCacheDeployable

See Also:
  Serialized Form

### Field Summary

Fields
`static int` `CACHE_MSG_IDX` Message index.
`protected static int` `DHT_ATOMIC_KEEP_BINARY_FLAG_MASK` Keep binary flag.
`protected static int` `DHT_ATOMIC_NEAR_FLAG_MASK` Near cache key flag.
`protected static int` `DHT_ATOMIC_OBSOLETE_NEAR_KEY_FLAG_MASK`
`protected static int` `DHT_ATOMIC_SKIP_STORE_FLAG_MASK` Skip store flag bit mask.
`protected static int` `DHT_ATOMIC_TRANSFORM_OP_FLAG_MASK` Flag indicating transformation operation was performed.
`protected byte` `flags` Additional flags.
`protected long` `futId` Future ID on primary.
`protected UUID` `nodeId` Node ID.
`protected UUID` `subjId` Subject ID.
`protected CacheWriteSynchronizationMode` `syncMode` Write synchronization mode.
`protected int` `taskNameHash` Task name hash.
`protected AffinityTopologyVersion` `topVer` Topology version.
`protected GridCacheVersion` `writeVer` Write version.

### 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
`protected` `GridDhtAtomicAbstractUpdateRequest()` Empty constructor required by `Externalizable`.
`protected` `GridDhtAtomicAbstractUpdateRequest(int cacheId, UUID nodeId, long futId, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, @NotNull AffinityTopologyVersion topVer, UUID subjId, int taskNameHash, boolean addDepInfo, boolean keepBinary, boolean skipStore)` Constructor.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`boolean` `addDeploymentInfo()` Deployment enabled flag indicates whether deployment info has to be added to this message.
`abstract void` `addNearWriteValue(KeyCacheObject key, @Nullable CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long expireTime)`
`abstract void` `addWriteValue(KeyCacheObject key, @Nullable CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long conflictExpireTime, @Nullable GridCacheVersion conflictVer, boolean addPrevVal, @Nullable CacheObject prevVal, long updateCntr, GridCacheOperation cacheOp)`
`protected abstract void` `cleanup()` Cleanup values not needed after message was sent.
`abstract long` `conflictExpireTime(int idx)`
`abstract @Nullable GridCacheVersion` `conflictVersion(int idx)`
`abstract @Nullable javax.cache.processor.EntryProcessor<Object,Object,Object>` `entryProcessor(int idx)`
`byte` `fieldsCount()` Gets fields count.
`byte` `flags()`
`abstract boolean` `forceTransformBackups()`
`long` `futureId()`
`abstract boolean` `hasKey(KeyCacheObject key)`
`abstract @Nullable Object[]` `invokeArguments()`
`boolean` `keepBinary()`
`abstract KeyCacheObject` `key(int idx)`
`int` `lookupIndex()` Gets message lookup index.
`IgniteLogger` `messageLogger(GridCacheSharedContext ctx)`
`abstract @Nullable javax.cache.processor.EntryProcessor<Object,Object,Object>` `nearEntryProcessor(int idx)`
`abstract long` `nearExpireTime(int idx)`
`long` `nearFutureId()`
`abstract KeyCacheObject` `nearKey(int idx)`
`UUID` `nearNodeId()`
`abstract int` `nearSize()`
`abstract long` `nearTtl(int idx)`
`abstract @Nullable CacheObject` `nearValue(int idx)`
`UUID` `nodeId()`
`abstract KeyCacheObject` `obsoleteNearKey(int idx)`
`abstract int` `obsoleteNearKeysSize()`
`void` `onAckReceived()` Method called when ack message received.
`boolean` `onResponse()`
`abstract @Nullable CacheObject` `previousValue(int idx)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`protected void` `setFlag(boolean flag, int mask)` Sets flag mask.
`abstract int` `size()`
`boolean` `skipStore()`
`UUID` `subjectId()`
`int` `taskNameHash()`
`AffinityTopologyVersion` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`String` `toString()`
`boolean` `transformOperation()`
`abstract long` `ttl(int idx)`
`abstract Long` `updateCounter(int updCntr)`
`abstract @Nullable 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.GridCacheIdMessage

`cacheGroupMessage, cacheId, cacheId, handlerId`

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

`appendFlag, classError, deployInfo, error, finishUnmarshal, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onClassError, partition, partitionExchangeMessage, prepare, prepareMarshal, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, prepareObject, 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`

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

`directType`

### Field Detail

#### DHT_ATOMIC_SKIP_STORE_FLAG_MASK

    protected static final int DHT_ATOMIC_SKIP_STORE_FLAG_MASK

Skip store flag bit mask.

See Also:
  Constant Field Values

#### DHT_ATOMIC_KEEP_BINARY_FLAG_MASK

    protected static final int DHT_ATOMIC_KEEP_BINARY_FLAG_MASK

Keep binary flag.

See Also:
  Constant Field Values

#### DHT_ATOMIC_NEAR_FLAG_MASK

    protected static final int DHT_ATOMIC_NEAR_FLAG_MASK

Near cache key flag.

See Also:
  Constant Field Values

#### DHT_ATOMIC_OBSOLETE_NEAR_KEY_FLAG_MASK

    protected static final int DHT_ATOMIC_OBSOLETE_NEAR_KEY_FLAG_MASK

See Also:
  Constant Field Values

#### DHT_ATOMIC_TRANSFORM_OP_FLAG_MASK

    protected static final int DHT_ATOMIC_TRANSFORM_OP_FLAG_MASK

Flag indicating transformation operation was performed.

See Also:
  Constant Field Values

#### CACHE_MSG_IDX

    public static final int CACHE_MSG_IDX

Message index.

#### futId

    protected long futId

Future ID on primary.

#### writeVer

    protected GridCacheVersion writeVer

Write version.

#### syncMode

    protected CacheWriteSynchronizationMode syncMode

Write synchronization mode.

#### topVer

    protected AffinityTopologyVersion topVer

Topology version.

#### subjId

    protected UUID subjId

Subject ID.

#### taskNameHash

    protected int taskNameHash

Task name hash.

#### nodeId

    protected UUID nodeId

Node ID.

#### flags

    protected byte flags

Additional flags.

### Constructor Detail

#### GridDhtAtomicAbstractUpdateRequest

    protected GridDhtAtomicAbstractUpdateRequest()

Empty constructor required by `Externalizable`.

#### GridDhtAtomicAbstractUpdateRequest

    protected GridDhtAtomicAbstractUpdateRequest(int cacheId,
                                                 UUID nodeId,
                                                 long futId,
                                                 GridCacheVersion writeVer,
                                                 CacheWriteSynchronizationMode syncMode,
                                                 @NotNull
                                                 @NotNull AffinityTopologyVersion topVer,
                                                 UUID subjId,
                                                 int taskNameHash,
                                                 boolean addDepInfo,
                                                 boolean keepBinary,
                                                 boolean skipStore)

Constructor.

Parameters:
  `cacheId` - Cache ID.
  `nodeId` - Node ID.

### Method Detail

#### topologyVersion

    public final AffinityTopologyVersion topologyVersion()

Gets topology version or -1 in case of topology version is not required for this message.

Overrides:
  `topologyVersion` in class `GridCacheMessage`
Returns:
  Topology version.

#### nearNodeId

    public UUID nearNodeId()

Returns:
  Near node ID.

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

#### flags

    public final byte flags()

Returns:
  Flags.

#### keepBinary

    public final boolean keepBinary()

Returns:
  Keep binary flag.

#### skipStore

    public final boolean skipStore()

Returns:
  Skip write-through to a persistent storage.

#### transformOperation

    public final boolean transformOperation()

Returns:
  `True` if transformation operation was performed.

#### onResponse

    public boolean onResponse()

Returns:
  `True` if on response flag changed.

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

#### forceTransformBackups

    public abstract boolean forceTransformBackups()

Returns:
  Force transform backups flag.

#### messageLogger

    public IgniteLogger messageLogger(GridCacheSharedContext ctx)

Overrides:
  `messageLogger` in class `GridCacheMessage`
Parameters:
  `ctx` - Context.
Returns:
  Logger.

#### onAckReceived

    public void onAckReceived()

Method called when ack message received.

Specified by:
  `onAckReceived` in interface `Message`
Overrides:
  `onAckReceived` in class `GridCacheMessage`

#### addWriteValue

    public abstract void addWriteValue(KeyCacheObject key,
                                       @Nullable
                                       @Nullable CacheObject val,
                                       javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                                       long ttl,
                                       long conflictExpireTime,
                                       @Nullable
                                       @Nullable GridCacheVersion conflictVer,
                                       boolean addPrevVal,
                                       @Nullable
                                       @Nullable CacheObject prevVal,
                                       long updateCntr,
                                       GridCacheOperation cacheOp)

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).
  `addPrevVal` - If `true` adds previous value.
  `prevVal` - Previous value.
  `updateCntr` - Update counter.
  `cacheOp` - Corresponding cache operation.

#### addNearWriteValue

    public abstract void addNearWriteValue(KeyCacheObject key,
                                           @Nullable
                                           @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.

#### cleanup

    protected abstract void cleanup()

Cleanup values not needed after message was sent.

#### subjectId

    public final UUID subjectId()

Returns:
  Subject ID.

#### taskNameHash

    public final int taskNameHash()

Returns:
  Task name.

#### futureId

    public final long futureId()

Returns:
  Future ID on primary node.

#### nearFutureId

    public final long nearFutureId()

Returns:
  Future ID on near node.

#### writeVersion

    public final GridCacheVersion writeVersion()

Returns:
  Write version.

#### writeSynchronizationMode

    public final CacheWriteSynchronizationMode writeSynchronizationMode()

Returns:
  Cache write synchronization mode.

#### size

    public abstract int size()

Returns:
  Keys size.

#### nearSize

    public abstract int nearSize()

Returns:
  Keys size.

#### hasKey

    public abstract boolean hasKey(KeyCacheObject key)

Parameters:
  `key` - Key to check.
Returns:
  `true` if request keys contain key.

#### key

    public abstract KeyCacheObject key(int idx)

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

#### obsoleteNearKeysSize

    public abstract int obsoleteNearKeysSize()

Returns:
  Obsolete near cache keys size.

#### obsoleteNearKey

    public abstract KeyCacheObject obsoleteNearKey(int idx)

Parameters:
  `idx` - Obsolete near cache key index.
Returns:
  Obsolete near cache key.

#### updateCounter

    public abstract Long updateCounter(int updCntr)

Parameters:
  `updCntr` - Update counter.
Returns:
  Update counter.

#### nearKey

    public abstract KeyCacheObject nearKey(int idx)

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

#### value

    @Nullable
    public abstract @Nullable CacheObject value(int idx)

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

#### previousValue

    @Nullable
    public abstract @Nullable CacheObject previousValue(int idx)

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

#### entryProcessor

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

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

#### nearValue

    @Nullable
    public abstract @Nullable CacheObject nearValue(int idx)

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

#### nearEntryProcessor

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

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

#### conflictVersion

    @Nullable
    public abstract @Nullable GridCacheVersion conflictVersion(int idx)

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

#### ttl

    public abstract long ttl(int idx)

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

#### nearTtl

    public abstract long nearTtl(int idx)

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

#### conflictExpireTime

    public abstract long conflictExpireTime(int idx)

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

#### nearExpireTime

    public abstract long nearExpireTime(int idx)

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

#### invokeArguments

    @Nullable
    public abstract @Nullable Object[] invokeArguments()

Returns:
  Optional arguments for entry processor.

#### setFlag

    protected final void setFlag(boolean flag,
                                 int mask)

Sets flag mask.

Parameters:
  `flag` - Set or clear.
  `mask` - Mask.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

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

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

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheIdMessage`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020