Class GridDistributedTxPrepareRequest
- 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.GridDistributedTxPrepareRequest
-
- All Implemented Interfaces:
Serializable,GridCacheDeployable,IgniteTxStateAware,GridCacheVersionable,Message
- Direct Known Subclasses:
GridDhtTxPrepareRequest,GridNearTxPrepareRequest
public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage implements IgniteTxStateAware
Transaction prepare request for optimistic and eventually consistent transactions.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intSTORE_WRITE_THROUGH_FLAG_MASK-
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 GridDistributedTxPrepareRequest()Required byExternalizable.GridDistributedTxPrepareRequest(IgniteInternalTx tx, long timeout, @Nullable Collection<IgniteTxEntry> reads, Collection<IgniteTxEntry> writes, Map<UUID,Collection<UUID>> txNodes, boolean retVal, boolean last, boolean onePhaseCommit, 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.voidaddDhtVersion(IgniteTxKey key, @Nullable GridCacheVersion dhtVer)Adds version to be verified on remote node.TransactionConcurrencyconcurrency()Map<IgniteTxKey,GridCacheVersion>dhtVersions()shortdirectType()Gets message type.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.booleanisInvalidate()TransactionIsolationisolation()booleanlast()IgniteLoggermessageLogger(GridCacheSharedContext<?,?> ctx)booleanneedReturnValue()voidneedReturnValue(boolean retVal)booleanonePhaseCommit()bytepolicy()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.Collection<IgniteTxEntry>reads()protected voidreads(Collection<IgniteTxEntry> reads)booleanstoreWriteThrough()voidstoreWriteThrough(boolean storeWriteThrough)booleansystem()longthreadId()longtimeout()StringtoString()Map<UUID,Collection<UUID>>transactionNodes()inttxSize()IgniteTxStatetxState()voidtxState(IgniteTxState txState)Collection<IgniteTxEntry>writes()protected voidwrites(Collection<IgniteTxEntry> writes)booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.GridCacheVersionwriteVersion()-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
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, error, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onAckReceived, onClassError, partition, 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
-
-
-
-
Field Detail
-
STORE_WRITE_THROUGH_FLAG_MASK
public static final int STORE_WRITE_THROUGH_FLAG_MASK
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GridDistributedTxPrepareRequest
public GridDistributedTxPrepareRequest()
Required byExternalizable.
-
GridDistributedTxPrepareRequest
public GridDistributedTxPrepareRequest(IgniteInternalTx tx, long timeout, @Nullable @Nullable Collection<IgniteTxEntry> reads, Collection<IgniteTxEntry> writes, Map<UUID,Collection<UUID>> txNodes, boolean retVal, boolean last, boolean onePhaseCommit, boolean addDepInfo)
- Parameters:
tx- Cache transaction.timeout- Transactions timeout.reads- Read entries.writes- Write entries.txNodes- Transaction nodes mapping.retVal- Return value flag.last- Last request flag.onePhaseCommit- One phase commit flag.addDepInfo- Deployment info flag.
-
-
Method Detail
-
needReturnValue
public final boolean needReturnValue()
- Returns:
- Flag indicating whether transaction needs return value.
-
needReturnValue
public final void needReturnValue(boolean retVal)
- Parameters:
retVal- Need return value.
-
transactionNodes
public Map<UUID,Collection<UUID>> transactionNodes()
- Returns:
- Transaction nodes mapping.
-
system
public final boolean system()
- Returns:
- System flag.
-
storeWriteThrough
public boolean storeWriteThrough()
- Returns:
- Flag indicating whether transaction use cache store.
-
storeWriteThrough
public void storeWriteThrough(boolean storeWriteThrough)
- Parameters:
storeWriteThrough- Store write through value.
-
policy
public byte policy()
- Returns:
- IO policy.
-
addDhtVersion
public void addDhtVersion(IgniteTxKey key, @Nullable @Nullable GridCacheVersion dhtVer)
Adds version to be verified on remote node.- Parameters:
key- Key for which version is verified.dhtVer- DHT version to check.
-
dhtVersions
public Map<IgniteTxKey,GridCacheVersion> dhtVersions()
- Returns:
- Map of versions to be verified.
-
threadId
public long threadId()
- Returns:
- Thread ID.
-
writeVersion
public GridCacheVersion writeVersion()
- Returns:
- Commit version.
-
isInvalidate
public boolean isInvalidate()
- Returns:
- Invalidate flag.
-
timeout
public long timeout()
- Returns:
- Transaction timeout.
-
concurrency
public TransactionConcurrency concurrency()
- Returns:
- Concurrency.
-
isolation
public TransactionIsolation isolation()
- Returns:
- Isolation level.
-
reads
public Collection<IgniteTxEntry> reads()
- Returns:
- Read set.
-
writes
public Collection<IgniteTxEntry> writes()
- Returns:
- Write entries.
-
reads
protected void reads(Collection<IgniteTxEntry> reads)
- Parameters:
reads- Reads.
-
writes
protected void writes(Collection<IgniteTxEntry> writes)
- Parameters:
writes- Writes.
-
txSize
public int txSize()
- Returns:
- Expected transaction size.
-
onePhaseCommit
public boolean onePhaseCommit()
- Returns:
- One phase commit flag.
-
last
public boolean last()
- Returns:
Trueif this is last prepare request for node.
-
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.
-
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.
-
addDeploymentInfo
public boolean addDeploymentInfo()
Deployment enabled flag indicates whether deployment info has to be added to this message.- Overrides:
addDeploymentInfoin classGridDistributedBaseMessage- 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 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
-
-