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 Description GridDhtAtomicUpdateRequest()Empty constructor required byExternalizable.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 Modifier and Type Method Description voidaddNearWriteValue(KeyCacheObject key, @Nullable CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long expireTime)voidaddWriteValue(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 voidcleanup()Cleanup values not needed after message was sent.longconflictExpireTime(int idx)@Nullable GridCacheVersionconflictVersion(int idx)shortdirectType()Gets message type.@Nullable javax.cache.processor.EntryProcessor<Object,Object,Object>entryProcessor(int idx)bytefieldsCount()Gets fields count.voidfinishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)This method is called after the message is deserialized and is responsible for unmarshalling state marshalled inGridCacheMessage.prepareMarshal(GridCacheSharedContext)method.booleanforceTransformBackups()booleanhasKey(KeyCacheObject key)@Nullable Object[]invokeArguments()KeyCacheObjectkey(int idx)@Nullable javax.cache.processor.EntryProcessor<Object,Object,Object>nearEntryProcessor(int idx)longnearExpireTime(int idx)KeyCacheObjectnearKey(int idx)intnearSize()longnearTtl(int idx)@Nullable CacheObjectnearValue(int idx)KeyCacheObjectobsoleteNearKey(int idx)intobsoleteNearKeysSize()intpartition()voidprepareMarshal(GridCacheSharedContext ctx)This method is called before the whole message is serialized and is responsible for pre-marshalling state.@Nullable CacheObjectpreviousValue(int idx)booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.intsize()StringtoString()longttl(int idx)LongupdateCounter(int updCntr)@Nullable CacheObjectvalue(int idx)booleanwriteTo(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 byExternalizable.
-
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:
addWriteValuein classGridDhtAtomicAbstractUpdateRequest- Parameters:
key- Key to add.val- Value,nullif should be removed.entryProcessor- Entry processor.ttl- TTL (optional).conflictExpireTime- Conflict expire time (optional).conflictVer- Conflict version (optional).addPrevVal- Iftrueadds 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:
addNearWriteValuein classGridDhtAtomicAbstractUpdateRequest- Parameters:
key- Key to add.val- Value,nullif should be removed.entryProcessor- Entry processor.ttl- TTL.expireTime- Expire time.
-
forceTransformBackups
public boolean forceTransformBackups()
- Specified by:
forceTransformBackupsin classGridDhtAtomicAbstractUpdateRequest- Returns:
- Force transform backups flag.
-
size
public int size()
- Specified by:
sizein classGridDhtAtomicAbstractUpdateRequest- Returns:
- Keys size.
-
nearSize
public int nearSize()
- Specified by:
nearSizein classGridDhtAtomicAbstractUpdateRequest- Returns:
- Keys size.
-
obsoleteNearKeysSize
public int obsoleteNearKeysSize()
- Specified by:
obsoleteNearKeysSizein classGridDhtAtomicAbstractUpdateRequest- Returns:
- Obsolete near cache keys size.
-
obsoleteNearKey
public KeyCacheObject obsoleteNearKey(int idx)
- Specified by:
obsoleteNearKeyin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Obsolete near cache key index.- Returns:
- Obsolete near cache key.
-
hasKey
public boolean hasKey(KeyCacheObject key)
- Specified by:
hasKeyin classGridDhtAtomicAbstractUpdateRequest- Parameters:
key- Key to check.- Returns:
trueif request keys contain key.
-
key
public KeyCacheObject key(int idx)
- Specified by:
keyin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Key.
-
updateCounter
public Long updateCounter(int updCntr)
- Specified by:
updateCounterin classGridDhtAtomicAbstractUpdateRequest- Parameters:
updCntr- Update counter.- Returns:
- Update counter.
-
nearKey
public KeyCacheObject nearKey(int idx)
- Specified by:
nearKeyin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Near key index.- Returns:
- Key.
-
value
@Nullable public @Nullable CacheObject value(int idx)
- Specified by:
valuein classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Value.
-
previousValue
@Nullable public @Nullable CacheObject previousValue(int idx)
- Specified by:
previousValuein classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Value.
-
entryProcessor
@Nullable public @Nullable javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor(int idx)
- Specified by:
entryProcessorin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Entry processor.
-
nearValue
@Nullable public @Nullable CacheObject nearValue(int idx)
- Specified by:
nearValuein classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Near key index.- Returns:
- Value.
-
nearEntryProcessor
@Nullable public @Nullable javax.cache.processor.EntryProcessor<Object,Object,Object> nearEntryProcessor(int idx)
- Specified by:
nearEntryProcessorin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Transform closure.
-
conflictVersion
@Nullable public @Nullable GridCacheVersion conflictVersion(int idx)
- Specified by:
conflictVersionin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- Conflict version.
-
ttl
public long ttl(int idx)
- Specified by:
ttlin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- TTL.
-
nearTtl
public long nearTtl(int idx)
- Specified by:
nearTtlin classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- TTL for near cache update.
-
partition
public int partition()
- Overrides:
partitionin classGridCacheMessage- Returns:
- Partition ID this message is targeted to or
-1if it cannot be determined.
-
conflictExpireTime
public long conflictExpireTime(int idx)
- Specified by:
conflictExpireTimein classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- Conflict expire time.
-
nearExpireTime
public long nearExpireTime(int idx)
- Specified by:
nearExpireTimein classGridDhtAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- Expire time for near cache update.
-
invokeArguments
@Nullable public @Nullable Object[] invokeArguments()
- Specified by:
invokeArgumentsin classGridDhtAtomicAbstractUpdateRequest- 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:
prepareMarshalin classGridCacheMessage- 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 inGridCacheMessage.prepareMarshal(GridCacheSharedContext)method.- Overrides:
finishUnmarshalin classGridCacheMessage- 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:
writeToin interfaceMessage- Overrides:
writeToin classGridDhtAtomicAbstractUpdateRequest- 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:
readFromin interfaceMessage- Overrides:
readFromin classGridDhtAtomicAbstractUpdateRequest- 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:
cleanupin classGridDhtAtomicAbstractUpdateRequest
-
directType
public short directType()
Gets message type.- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridDhtAtomicAbstractUpdateRequest- Returns:
- Fields count.
-
toString
public String toString()
- Overrides:
toStringin classGridDhtAtomicAbstractUpdateRequest
-
-