Class GridNearAtomicSingleUpdateRequest
- 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.GridNearAtomicAbstractUpdateRequest
-
- org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractSingleUpdateRequest
-
- org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateRequest
-
- All Implemented Interfaces:
Serializable,GridCacheDeployable,Message
- Direct Known Subclasses:
GridNearAtomicSingleUpdateFilterRequest,GridNearAtomicSingleUpdateInvokeRequest
public class GridNearAtomicSingleUpdateRequest extends GridNearAtomicAbstractSingleUpdateRequest
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected KeyCacheObjectkeyKey to update.protected CacheObjectvalValue to update.-
Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateRequest
CACHE_MSG_IDX, flags, futId, nodeId, op, syncMode, taskNameHash, topVer
-
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 GridNearAtomicSingleUpdateRequest()Empty constructor required byExternalizable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUpdateEntry(KeyCacheObject key, @Nullable Object val, long conflictTtl, long conflictExpireTime, @Nullable GridCacheVersion conflictVer)voidcleanup(boolean clearKey)Cleanup values.longconflictExpireTime(int idx)longconflictTtl(int idx)@Nullable GridCacheVersionconflictVersion(int idx)@Nullable List<GridCacheVersion>conflictVersions()shortdirectType()Gets message type.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.KeyCacheObjectkey(int idx)List<KeyCacheObject>keys()intpartition()voidprepareMarshal(GridCacheSharedContext ctx)This method is called before the whole message is serialized and is responsible for pre-marshalling state.booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.intsize()StringtoString()CacheObjectvalue(int idx)List<?>values()booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.CacheObjectwriteValue(int idx)-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractSingleUpdateRequest
expiry, filter, invokeArguments
-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateRequest
addDeploymentInfo, futureId, keepBinary, keepBinary, lookupIndex, messageLogger, nearCache, nodeId, onResponse, operation, recovery, recovery, response, returnValue, returnValue, skipStore, skipStore, taskNameHash, topologyVersion, writeSynchronizationMode
-
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, onAckReceived, 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
-
-
-
-
Field Detail
-
key
@GridToStringInclude protected KeyCacheObject key
Key to update.
-
val
protected CacheObject val
Value to update.
-
-
Constructor Detail
-
GridNearAtomicSingleUpdateRequest
public GridNearAtomicSingleUpdateRequest()
Empty constructor required byExternalizable.
-
-
Method Detail
-
partition
public int partition()
- Overrides:
partitionin classGridCacheMessage- Returns:
- Partition ID this message is targeted to or
-1if it cannot be determined.
-
addUpdateEntry
public void addUpdateEntry(KeyCacheObject key, @Nullable @Nullable Object val, long conflictTtl, long conflictExpireTime, @Nullable @Nullable GridCacheVersion conflictVer)
- Parameters:
key- Key to add.val- Optional update value.conflictTtl- Conflict TTL (optional).conflictExpireTime- Conflict expire time (optional).conflictVer- Conflict version (optional).
-
size
public int size()
- Specified by:
sizein classGridNearAtomicAbstractUpdateRequest- Returns:
- Keys size.
-
keys
public List<KeyCacheObject> keys()
- Specified by:
keysin classGridNearAtomicAbstractUpdateRequest- Returns:
- Keys for this update request.
-
key
public KeyCacheObject key(int idx)
- Specified by:
keyin classGridNearAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Key.
-
values
public List<?> values()
- Specified by:
valuesin classGridNearAtomicAbstractUpdateRequest- Returns:
- Values for this update request.
-
value
public CacheObject value(int idx)
- Specified by:
valuein classGridNearAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Value.
-
entryProcessor
public javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor(int idx)
- Specified by:
entryProcessorin classGridNearAtomicAbstractUpdateRequest- Parameters:
idx- Key index.- Returns:
- Entry processor.
-
writeValue
public CacheObject writeValue(int idx)
- Specified by:
writeValuein classGridNearAtomicAbstractUpdateRequest- Parameters:
idx- Index to get.- Returns:
- Write value - either value, or transform closure.
-
conflictVersions
@Nullable public @Nullable List<GridCacheVersion> conflictVersions()
- Specified by:
conflictVersionsin classGridNearAtomicAbstractUpdateRequest- Returns:
- Conflict versions.
-
conflictVersion
@Nullable public @Nullable GridCacheVersion conflictVersion(int idx)
- Specified by:
conflictVersionin classGridNearAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- Conflict version.
-
conflictTtl
public long conflictTtl(int idx)
- Specified by:
conflictTtlin classGridNearAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- Conflict TTL.
-
conflictExpireTime
public long conflictExpireTime(int idx)
- Specified by:
conflictExpireTimein classGridNearAtomicAbstractUpdateRequest- Parameters:
idx- Index.- Returns:
- Conflict expire time.
-
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 classGridNearAtomicAbstractUpdateRequest- 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 classGridNearAtomicAbstractUpdateRequest- Parameters:
buf- Byte buffer.reader- Reader.- Returns:
- Whether message was fully read.
-
cleanup
public void cleanup(boolean clearKey)
Cleanup values.- Specified by:
cleanupin classGridNearAtomicAbstractUpdateRequest- Parameters:
clearKey- Iftrueclears keys.
-
directType
public short directType()
Gets message type.- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridNearAtomicAbstractUpdateRequest- Returns:
- Fields count.
-
toString
public String toString()
- Overrides:
toStringin classGridNearAtomicAbstractSingleUpdateRequest
-
-