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 Modifier and Type Field Description static intCACHE_MSG_IDXMessage index.protected static intDHT_ATOMIC_KEEP_BINARY_FLAG_MASKKeep binary flag.protected static intDHT_ATOMIC_NEAR_FLAG_MASKNear cache key flag.protected static intDHT_ATOMIC_OBSOLETE_NEAR_KEY_FLAG_MASKprotected static intDHT_ATOMIC_READ_REPAIR_RECOVERY_FLAG_MASKFlag indicating recovery on read repair.protected static intDHT_ATOMIC_SKIP_STORE_FLAG_MASKSkip store flag bit mask.protected static intDHT_ATOMIC_TRANSFORM_OP_FLAG_MASKFlag indicating transformation operation was performed.protected byteflagsAdditional flags.protected longfutIdFuture ID on primary.protected UUIDnodeIdNode ID.protected CacheWriteSynchronizationModesyncModeWrite synchronization mode.protected inttaskNameHashTask name hash.protected AffinityTopologyVersiontopVerTopology version.protected GridCacheVersionwriteVerWrite 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 Modifier Constructor Description protectedGridDhtAtomicAbstractUpdateRequest()Empty constructor required byExternalizable.protectedGridDhtAtomicAbstractUpdateRequest(int cacheId, UUID nodeId, long futId, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, @NotNull AffinityTopologyVersion topVer, int taskNameHash, boolean addDepInfo, boolean keepBinary, boolean skipStore, boolean readRepairRecovery)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddDeploymentInfo()Deployment enabled flag indicates whether deployment info has to be added to this message.abstract voidaddNearWriteValue(KeyCacheObject key, @Nullable CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, long ttl, long expireTime)abstract 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 abstract voidcleanup()Cleanup values not needed after message was sent.abstract longconflictExpireTime(int idx)abstract @Nullable GridCacheVersionconflictVersion(int idx)abstract @Nullable javax.cache.processor.EntryProcessor<Object,Object,Object>entryProcessor(int idx)bytefieldsCount()Gets fields count.byteflags()abstract booleanforceTransformBackups()longfutureId()abstract booleanhasKey(KeyCacheObject key)abstract @Nullable Object[]invokeArguments()booleankeepBinary()abstract KeyCacheObjectkey(int idx)intlookupIndex()Gets message lookup index.IgniteLoggermessageLogger(GridCacheSharedContext ctx)abstract @Nullable javax.cache.processor.EntryProcessor<Object,Object,Object>nearEntryProcessor(int idx)abstract longnearExpireTime(int idx)longnearFutureId()abstract KeyCacheObjectnearKey(int idx)UUIDnearNodeId()abstract intnearSize()abstract longnearTtl(int idx)abstract @Nullable CacheObjectnearValue(int idx)UUIDnodeId()abstract KeyCacheObjectobsoleteNearKey(int idx)abstract intobsoleteNearKeysSize()voidonAckReceived()Method called when ack message received.booleanonResponse()abstract @Nullable CacheObjectpreviousValue(int idx)booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.booleanreadRepairRecovery()protected voidsetFlag(boolean flag, int mask)Sets flag mask.abstract intsize()booleanskipStore()inttaskNameHash()AffinityTopologyVersiontopologyVersion()Gets topology version or -1 in case of topology version is not required for this message.StringtoString()booleantransformOperation()abstract longttl(int idx)abstract LongupdateCounter(int updCntr)abstract @Nullable CacheObjectvalue(int idx)CacheWriteSynchronizationModewriteSynchronizationMode()booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.GridCacheVersionwriteVersion()-
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
-
DHT_ATOMIC_READ_REPAIR_RECOVERY_FLAG_MASK
protected static final int DHT_ATOMIC_READ_REPAIR_RECOVERY_FLAG_MASK
Flag indicating recovery on read repair.- 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.
-
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 byExternalizable.
-
GridDhtAtomicAbstractUpdateRequest
protected GridDhtAtomicAbstractUpdateRequest(int cacheId, UUID nodeId, long futId, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, @NotNull @NotNull AffinityTopologyVersion topVer, int taskNameHash, boolean addDepInfo, boolean keepBinary, boolean skipStore, boolean readRepairRecovery)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:
topologyVersionin classGridCacheMessage- 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 toGridCacheMessage.MAX_CACHE_MSG_LOOKUP_INDEX.- Overrides:
lookupIndexin classGridCacheMessage- 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.
-
readRepairRecovery
public final boolean readRepairRecovery()
- Returns:
- Recovery on Read Repair flag.
-
skipStore
public final boolean skipStore()
- Returns:
- Skip write-through to a persistent storage.
-
transformOperation
public final boolean transformOperation()
- Returns:
Trueif transformation operation was performed.
-
onResponse
public boolean onResponse()
- Returns:
Trueif on response flag changed.
-
addDeploymentInfo
public boolean addDeploymentInfo()
Deployment enabled flag indicates whether deployment info has to be added to this message.- Specified by:
addDeploymentInfoin classGridCacheMessage- Returns:
trueor if deployment info must be added to the the message,falseotherwise.
-
forceTransformBackups
public abstract boolean forceTransformBackups()
- Returns:
- Force transform backups flag.
-
messageLogger
public IgniteLogger messageLogger(GridCacheSharedContext ctx)
- Overrides:
messageLoggerin classGridCacheMessage- Parameters:
ctx- Context.- Returns:
- Logger.
-
onAckReceived
public void onAckReceived()
Method called when ack message received.- Specified by:
onAckReceivedin interfaceMessage- Overrides:
onAckReceivedin classGridCacheMessage
-
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,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 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,nullif should be removed.entryProcessor- Entry processor.ttl- TTL.expireTime- Expire time.
-
cleanup
protected abstract void cleanup()
Cleanup values not needed after message was sent.
-
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:
trueif 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:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridCacheIdMessage- Returns:
- Fields count.
-
writeTo
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
Writes this message to provided byte buffer.- Specified by:
writeToin interfaceMessage- Overrides:
writeToin classGridCacheIdMessage- 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 classGridCacheIdMessage- Parameters:
buf- Byte buffer.reader- Reader.- Returns:
- Whether message was fully read.
-
toString
public String toString()
- Overrides:
toStringin classGridCacheIdMessage
-
-