Class GridNearAtomicUpdateResponse
- 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.GridNearAtomicUpdateResponse
-
- All Implemented Interfaces:
Serializable,GridCacheDeployable,Message
public class GridNearAtomicUpdateResponse extends GridCacheIdMessage implements GridCacheDeployable
DHT atomic cache near update response.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intCACHE_MSG_IDXCache message index.-
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 GridNearAtomicUpdateResponse()Empty constructor required byExternalizable.GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, long futId, int partId, boolean nodeLeft, boolean addDepInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddDeploymentInfo()Deployment enabled flag indicates whether deployment info has to be added to this message.voidaddFailedKey(KeyCacheObject key, Throwable e)Adds key to collection of failed keys.shortdirectType()Gets message type.IgniteCheckedExceptionerror()voiderror(IgniteCheckedException err)Sets update error.Collection<KeyCacheObject>failedKeys()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.longfutureId()intlookupIndex()Gets message lookup index.@Nullable List<UUID>mapping()voidmapping(List<UUID> mapping)IgniteLoggermessageLogger(GridCacheSharedContext ctx)longnearExpireTime(int idx)longnearTtl(int idx)@Nullable CacheObjectnearValue(int idx)@Nullable List<Integer>nearValuesIndexes()GridCacheVersionnearVersion()UUIDnodeId()voidnodeId(UUID nodeId)booleannodeLeftResponse()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.GridCacheReturnreturnValue()voidreturnValue(GridCacheReturn ret)@Nullable List<Integer>skippedIndexes()StringtoString()booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.-
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, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onAckReceived, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, prepareObject, topologyVersion, 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
-
GridNearAtomicUpdateResponse
public GridNearAtomicUpdateResponse()
Empty constructor required byExternalizable.
-
GridNearAtomicUpdateResponse
public GridNearAtomicUpdateResponse(int cacheId, UUID nodeId, long futId, int partId, boolean nodeLeft, boolean addDepInfo)- Parameters:
cacheId- Cache ID.nodeId- Node ID this reply should be sent to.futId- Future ID.partId- Partition.nodeLeft-Trueif primary node failed.addDepInfo- Deployment info flag.
-
-
Method Detail
-
nodeLeftResponse
public boolean nodeLeftResponse()
- Returns:
Trueif primary node failed.
-
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 this response should be sent to.
-
nodeId
public void nodeId(UUID nodeId)
- Parameters:
nodeId- Node ID.
-
futureId
public long futureId()
- Returns:
- Future ID.
-
error
public void error(IgniteCheckedException err)
Sets update error.- Parameters:
err- Error.
-
error
public IgniteCheckedException error()
- Overrides:
errorin classGridCacheMessage- Returns:
- Error, if any.
-
failedKeys
public Collection<KeyCacheObject> failedKeys()
- Returns:
- Collection of failed keys.
-
returnValue
public GridCacheReturn returnValue()
- Returns:
- Return value.
-
returnValue
public void returnValue(GridCacheReturn ret)
- Parameters:
ret- Return value.
-
nearExpireTime
public long nearExpireTime(int idx)
- Parameters:
idx- Index.- Returns:
- Expire time for near cache update.
-
nearTtl
public long nearTtl(int idx)
- Parameters:
idx- Index.- Returns:
- TTL for near cache update.
-
nearVersion
public GridCacheVersion nearVersion()
- Returns:
- Version generated on primary node to be used for originating node's near cache update.
-
skippedIndexes
@Nullable public @Nullable List<Integer> skippedIndexes()
- Returns:
- Indexes of keys for which update was skipped
-
nearValuesIndexes
@Nullable public @Nullable List<Integer> nearValuesIndexes()
- Returns:
- Indexes of keys for which values were generated on primary node.
-
nearValue
@Nullable public @Nullable CacheObject nearValue(int idx)
- Parameters:
idx- Index.- Returns:
- Value generated on primary node which should be put to originating node's near cache.
-
addFailedKey
public void addFailedKey(KeyCacheObject key, Throwable e)
Adds key to collection of failed keys.- Parameters:
key- Key to add.e- Error cause.
-
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-- 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.
-
partition
public int partition()
- Overrides:
partitionin classGridCacheMessage- Returns:
- Partition ID this message is targeted to or
-1if it cannot be determined.
-
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.
-
messageLogger
public IgniteLogger messageLogger(GridCacheSharedContext ctx)
- Overrides:
messageLoggerin classGridCacheMessage- Parameters:
ctx- Context.- Returns:
- Logger.
-
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.
-
directType
public short directType()
Gets message type.- Specified by:
directTypein interfaceMessage- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridCacheIdMessage- Returns:
- Fields count.
-
toString
public String toString()
- Overrides:
toStringin classGridCacheIdMessage
-
-