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.GridCacheIdMessage
    - - org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateRequest
      - - org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicUpdateRequest

All Implemented Interfaces:
  Serializable, GridCacheDeployable, Message

    public class GridDhtAtomicUpdateRequest
    extends GridDhtAtomicAbstractUpdateRequest

Lite dht cache backup update request.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateRequest

`CACHE_MSG_IDX, DHT_ATOMIC_KEEP_BINARY_FLAG_MASK, DHT_ATOMIC_NEAR_FLAG_MASK, DHT_ATOMIC_OBSOLETE_NEAR_KEY_FLAG_MASK, DHT_ATOMIC_READ_REPAIR_RECOVERY_FLAG_MASK, DHT_ATOMIC_SKIP_STORE_FLAG_MASK, DHT_ATOMIC_TRANSFORM_OP_FLAG_MASK, flags, futId, nodeId, syncMode, taskNameHash, topVer, writeVer`

### 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
`GridDhtAtomicUpdateRequest()` Empty constructor required by `Externalizable`.
`GridDhtAtomicUpdateRequest(int cacheId, UUID nodeId, long futId, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, @NotNull AffinityTopologyVersion topVer, int taskNameHash, Object[] invokeArgs, boolean addDepInfo, boolean keepBinary, boolean skipStore, boolean forceTransformBackups, boolean readRepairRecovery)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addNearWriteValue(KeyCacheObject key, @Nullable CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long expireTime)`
`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 void` `cleanup()` Cleanup values not needed after message was sent.
`long` `conflictExpireTime(int idx)`
`@Nullable GridCacheVersion` `conflictVersion(int idx)`
`short` `directType()` Gets message type.
`@Nullable 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()`
`boolean` `hasKey(KeyCacheObject key)`
`@Nullable Object[]` `invokeArguments()`
`KeyCacheObject` `key(int idx)`
`@Nullable javax.cache.processor.EntryProcessor<Object,Object,Object>` `nearEntryProcessor(int idx)`
`long` `nearExpireTime(int idx)`
`KeyCacheObject` `nearKey(int idx)`
`int` `nearSize()`
`long` `nearTtl(int idx)`
`@Nullable CacheObject` `nearValue(int idx)`
`KeyCacheObject` `obsoleteNearKey(int idx)`
`int` `obsoleteNearKeysSize()`
`int` `partition()`
`void` `prepareMarshal(GridCacheSharedContext ctx)` This method is called before the whole message is serialized and is responsible for pre-marshalling state.
`@Nullable CacheObject` `previousValue(int idx)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`int` `size()`
`String` `toString()`
`long` `ttl(int idx)`
`Long` `updateCounter(int updCntr)`
`@Nullable CacheObject` `value(int idx)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateRequest

`addDeploymentInfo, flags, futureId, keepBinary, lookupIndex, messageLogger, nearFutureId, nearNodeId, nodeId, onAckReceived, onResponse, readRepairRecovery, setFlag, skipStore, taskNameHash, topologyVersion, transformOperation, writeSynchronizationMode, 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, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onClassError, partitionExchangeMessage, prepare, 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`

### Constructor Detail

#### GridDhtAtomicUpdateRequest

    public GridDhtAtomicUpdateRequest()

Empty constructor required by `Externalizable`.

#### GridDhtAtomicUpdateRequest

    public GridDhtAtomicUpdateRequest(int cacheId,
                                      UUID nodeId,
                                      long futId,
                                      GridCacheVersion writeVer,
                                      CacheWriteSynchronizationMode syncMode,
                                      @NotNull
                                      @NotNull AffinityTopologyVersion topVer,
                                      int taskNameHash,
                                      Object[] invokeArgs,
                                      boolean addDepInfo,
                                      boolean keepBinary,
                                      boolean skipStore,
                                      boolean forceTransformBackups,
                                      boolean readRepairRecovery)

Constructor.

Parameters:
  `cacheId` - Cache ID.
  `nodeId` - Node ID.
  `futId` - Future ID.
  `writeVer` - Write version for cache values.
  `invokeArgs` - Optional arguments for entry processor.
  `syncMode` - Cache write synchronization mode.
  `topVer` - Topology version.
  `keepBinary` - Keep binary flag.
  `skipStore` - Skip store flag.
  `forceTransformBackups` - Force transform backups flag.
  `taskNameHash` - Task name hash code.
  `addDepInfo` - Deployment info.
  `readRepairRecovery` - Recovery on Read Repair flag.

### Method Detail

#### addWriteValue

    public 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)

Specified by:
  `addWriteValue` in class `GridDhtAtomicAbstractUpdateRequest`
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 void addNearWriteValue(KeyCacheObject key,
                                  @Nullable
                                  @Nullable CacheObject val,
                                  javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
                                  long ttl,
                                  long expireTime)

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

#### forceTransformBackups

    public boolean forceTransformBackups()

Specified by:
  `forceTransformBackups` in class `GridDhtAtomicAbstractUpdateRequest`
Returns:
  Force transform backups flag.

#### size

    public int size()

Specified by:
  `size` in class `GridDhtAtomicAbstractUpdateRequest`
Returns:
  Keys size.

#### nearSize

    public int nearSize()

Specified by:
  `nearSize` in class `GridDhtAtomicAbstractUpdateRequest`
Returns:
  Keys size.

#### obsoleteNearKeysSize

    public int obsoleteNearKeysSize()

Specified by:
  `obsoleteNearKeysSize` in class `GridDhtAtomicAbstractUpdateRequest`
Returns:
  Obsolete near cache keys size.

#### obsoleteNearKey

    public KeyCacheObject obsoleteNearKey(int idx)

Specified by:
  `obsoleteNearKey` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Obsolete near cache key index.
Returns:
  Obsolete near cache key.

#### hasKey

    public boolean hasKey(KeyCacheObject key)

Specified by:
  `hasKey` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `key` - Key to check.
Returns:
  `true` if request keys contain key.

#### key

    public KeyCacheObject key(int idx)

Specified by:
  `key` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Key index.
Returns:
  Key.

#### updateCounter

    public Long updateCounter(int updCntr)

Specified by:
  `updateCounter` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `updCntr` - Update counter.
Returns:
  Update counter.

#### nearKey

    public KeyCacheObject nearKey(int idx)

Specified by:
  `nearKey` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Near key index.
Returns:
  Key.

#### value

    @Nullable
    public @Nullable CacheObject value(int idx)

Specified by:
  `value` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Key index.
Returns:
  Value.

#### previousValue

    @Nullable
    public @Nullable CacheObject previousValue(int idx)

Specified by:
  `previousValue` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Key index.
Returns:
  Value.

#### entryProcessor

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

Specified by:
  `entryProcessor` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Key index.
Returns:
  Entry processor.

#### nearValue

    @Nullable
    public @Nullable CacheObject nearValue(int idx)

Specified by:
  `nearValue` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Near key index.
Returns:
  Value.

#### nearEntryProcessor

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

Specified by:
  `nearEntryProcessor` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Key index.
Returns:
  Transform closure.

#### conflictVersion

    @Nullable
    public @Nullable GridCacheVersion conflictVersion(int idx)

Specified by:
  `conflictVersion` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Index.
Returns:
  Conflict version.

#### ttl

    public long ttl(int idx)

Specified by:
  `ttl` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Index.
Returns:
  TTL.

#### nearTtl

    public long nearTtl(int idx)

Specified by:
  `nearTtl` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Index.
Returns:
  TTL for near cache update.

#### partition

    public int partition()

Overrides:
  `partition` in class `GridCacheMessage`
Returns:
  Partition ID this message is targeted to or `-1` if it cannot be determined.

#### conflictExpireTime

    public long conflictExpireTime(int idx)

Specified by:
  `conflictExpireTime` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Index.
Returns:
  Conflict expire time.

#### nearExpireTime

    public long nearExpireTime(int idx)

Specified by:
  `nearExpireTime` in class `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `idx` - Index.
Returns:
  Expire time for near cache update.

#### invokeArguments

    @Nullable
    public @Nullable Object[] invokeArguments()

Specified by:
  `invokeArguments` in class `GridDhtAtomicAbstractUpdateRequest`
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` - Cache context.
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 `GridDhtAtomicAbstractUpdateRequest`
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 `GridDhtAtomicAbstractUpdateRequest`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### cleanup

    protected void cleanup()

Cleanup values not needed after message was sent.

Specified by:
  `cleanup` in class `GridDhtAtomicAbstractUpdateRequest`

#### directType

    public short directType()

Gets message type.

Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

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

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDhtAtomicAbstractUpdateRequest`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023