Class GridDhtTxPrepareRequest
- 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
-
- org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareRequest
-
- All Implemented Interfaces:
Serializable,GridCacheDeployable,IgniteTxStateAware,GridCacheVersionable,Message
public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
DHT prepare request.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxPrepareRequest
STORE_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 GridDhtTxPrepareRequest()Empty constructor required forExternalizable.GridDhtTxPrepareRequest(IgniteUuid futId, int miniId, AffinityTopologyVersion topVer, GridDhtTxLocalAdapter tx, long timeout, Collection<IgniteTxEntry> dhtWrites, Collection<IgniteTxEntry> nearWrites, Map<UUID,Collection<UUID>> txNodes, GridCacheVersion nearXidVer, boolean last, boolean onePhaseCommit, int taskNameHash, boolean addDepInfo, boolean storeWriteThrough, boolean retVal, Collection<PartitionUpdateCountersMessage> updCntrs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.IgniteUuidfutureId()booleaninvalidateNearEntry(int idx)intminiId()UUIDnearNodeId()Collection<IgniteTxEntry>nearWrites()@Nullable List<IgniteTxKey>nearWritesCacheMissed()GridCacheVersionnearXidVersion()booleanneedPreloadKey(int idx)Checks whether entry info should be sent to primary node from backup.Map<IgniteTxKey,GridCacheVersion>owned()voidowned(IgniteTxKey key, GridCacheVersion ownerMapped)Sets owner and its mapped version.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.booleanskipCompletedVersion()inttaskNameHash()AffinityTopologyVersiontopologyVersion()Gets topology version or -1 in case of topology version is not required for this message.StringtoString()@Nullable StringtxLabel()Collection<PartitionUpdateCountersMessage>updateCounters()booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxPrepareRequest
addDeploymentInfo, addDhtVersion, concurrency, dhtVersions, isInvalidate, isolation, last, messageLogger, needReturnValue, needReturnValue, onePhaseCommit, policy, reads, reads, storeWriteThrough, storeWriteThrough, system, threadId, timeout, transactionNodes, txSize, txState, txState, writes, writes, writeVersion
-
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, 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
-
-
-
-
Constructor Detail
-
GridDhtTxPrepareRequest
public GridDhtTxPrepareRequest()
Empty constructor required forExternalizable.
-
GridDhtTxPrepareRequest
public GridDhtTxPrepareRequest(IgniteUuid futId, int miniId, AffinityTopologyVersion topVer, GridDhtTxLocalAdapter tx, long timeout, Collection<IgniteTxEntry> dhtWrites, Collection<IgniteTxEntry> nearWrites, Map<UUID,Collection<UUID>> txNodes, GridCacheVersion nearXidVer, boolean last, boolean onePhaseCommit, int taskNameHash, boolean addDepInfo, boolean storeWriteThrough, boolean retVal, Collection<PartitionUpdateCountersMessage> updCntrs)
- Parameters:
futId- Future ID.miniId- Mini future ID.topVer- Topology version.tx- Transaction.timeout- Transaction timeout.dhtWrites- DHT writes.nearWrites- Near writes.txNodes- Transaction nodes mapping.nearXidVer- Near transaction ID.last-Trueif this is last prepare request for node.addDepInfo- Deployment info flag.storeWriteThrough- Cache store write through flag.retVal- Need return value flagupdCntrs- Update counters for Tx.
-
-
Method Detail
-
updateCounters
public Collection<PartitionUpdateCountersMessage> updateCounters()
- Returns:
- Update counters list.
-
nearWritesCacheMissed
@Nullable public @Nullable List<IgniteTxKey> nearWritesCacheMissed()
- Returns:
- Near cache writes for which cache was not found (possible if client near cache was closed).
-
nearXidVersion
public GridCacheVersion nearXidVersion()
- Returns:
- Near transaction ID.
-
nearNodeId
public UUID nearNodeId()
- Returns:
- Near node ID.
-
taskNameHash
public int taskNameHash()
- Returns:
- Task name hash.
-
nearWrites
public Collection<IgniteTxEntry> nearWrites()
- Returns:
- Near writes.
-
invalidateNearEntry
public boolean invalidateNearEntry(int idx)
- Parameters:
idx- Index to get invalidation flag value.- Returns:
- Invalidation flag value.
-
needPreloadKey
public boolean needPreloadKey(int idx)
Checks whether entry info should be sent to primary node from backup.- Parameters:
idx- Index.- Returns:
Trueif value should be sent,falseotherwise.
-
futureId
public IgniteUuid futureId()
- Returns:
- Future ID.
-
miniId
public int miniId()
- Returns:
- Mini future ID.
-
topologyVersion
public AffinityTopologyVersion topologyVersion()
Description copied from class:GridCacheMessageGets topology version or -1 in case of topology version is not required for this message.- Overrides:
topologyVersionin classGridCacheMessage- Returns:
- Topology version.
-
owned
public void owned(IgniteTxKey key, GridCacheVersion ownerMapped)
Sets owner and its mapped version.- Parameters:
key- Key.ownerMapped- Owner mapped version.
-
owned
public Map<IgniteTxKey,GridCacheVersion> owned()
- Returns:
- Owned versions map.
-
skipCompletedVersion
public boolean skipCompletedVersion()
- Returns:
Trueif remote tx should skip adding itself to completed versions map on finish.
-
txLabel
@Nullable public @Nullable String txLabel()
- Returns:
- Transaction label.
-
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 classGridDistributedTxPrepareRequest- 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 classGridDistributedTxPrepareRequest- 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 classGridDistributedTxPrepareRequest- 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 classGridDistributedTxPrepareRequest- Parameters:
buf- Byte buffer.reader- Reader.- Returns:
- Whether message was fully read.
-
directType
public short directType()
Gets message type.- Specified by:
directTypein interfaceMessage- Overrides:
directTypein classGridDistributedTxPrepareRequest- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridDistributedTxPrepareRequest- Returns:
- Fields count.
-
partition
public int partition()
- Overrides:
partitionin classGridCacheMessage- Returns:
- Partition ID this message is targeted to or
-1if it cannot be determined.
-
toString
public String toString()
- Overrides:
toStringin classGridDistributedTxPrepareRequest
-
-