Class GridDistributedTxPrepareResponse
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheMessage
-
- org.apache.ignite.internal.processors.cache.GridCacheIdMessage
-
- org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
-
- org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxPrepareResponse
-
- All Implemented Interfaces:
Serializable,GridCacheDeployable,IgniteTxStateAware,GridCacheVersionable,Message
- Direct Known Subclasses:
GridDhtTxPrepareResponse,GridNearTxPrepareResponse
public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage implements IgniteTxStateAware
Response to prepare request.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected byteflags-
Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
ver
-
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 GridDistributedTxPrepareResponse()Empty constructor (required byExternalizable).GridDistributedTxPrepareResponse(int part, GridCacheVersion xid, boolean addDepInfo)GridDistributedTxPrepareResponse(int part, GridCacheVersion xid, Throwable err, boolean addDepInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description shortdirectType()Gets message type.Throwableerror()voiderror(Throwable err)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.protected booleanisFlag(int mask)Reags flag mask.booleanisRollback()IgniteLoggermessageLogger(GridCacheSharedContext<?,?> ctx)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.protected voidsetFlag(boolean flag, int mask)Sets flag mask.StringtoString()IgniteTxStatetxState()voidtxState(IgniteTxState txState)booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
addDeploymentInfo, committedVersions, completedVersions, rolledbackVersions, version, version
-
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, lookupIndex, 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
-
GridDistributedTxPrepareResponse
public GridDistributedTxPrepareResponse()
Empty constructor (required byExternalizable).
-
GridDistributedTxPrepareResponse
public GridDistributedTxPrepareResponse(int part, GridCacheVersion xid, boolean addDepInfo)- Parameters:
part- Partition.xid- Lock or transaction ID.addDepInfo- Deployment info flag.
-
GridDistributedTxPrepareResponse
public GridDistributedTxPrepareResponse(int part, GridCacheVersion xid, Throwable err, boolean addDepInfo)- Parameters:
part- Partition.xid- Lock or transaction ID.err- Error.addDepInfo- Deployment info flag.
-
-
Method Detail
-
setFlag
protected final void setFlag(boolean flag, int mask)Sets flag mask.- Parameters:
flag- Set or clear.mask- Mask.
-
isFlag
protected final boolean isFlag(int mask)
Reags flag mask.- Parameters:
mask- Mask to read.- Returns:
- Flag value.
-
partition
public int partition()
- Overrides:
partitionin classGridCacheMessage- Returns:
- Partition ID this message is targeted to or
-1if it cannot be determined.
-
error
public Throwable error()
- Overrides:
errorin classGridCacheMessage- Returns:
- Error, if any.
-
error
public void error(Throwable err)
- Parameters:
err- Error to set.
-
isRollback
public boolean isRollback()
- Returns:
- Rollback flag.
-
txState
public IgniteTxState txState()
- Specified by:
txStatein interfaceIgniteTxStateAware- Returns:
- Transient TX state.
-
txState
public void txState(IgniteTxState txState)
- Specified by:
txStatein interfaceIgniteTxStateAware- Parameters:
txState- Transient TX state.
-
messageLogger
public IgniteLogger messageLogger(GridCacheSharedContext<?,?> ctx)
- Overrides:
messageLoggerin classGridCacheMessage- Parameters:
ctx- Context.- Returns:
- Logger.
-
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 classGridDistributedBaseMessage- 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 classGridDistributedBaseMessage- 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 classGridDistributedBaseMessage
-
-