Class GridDistributedLockRequest
- 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.GridDistributedLockRequest
-
- All Implemented Interfaces:
Serializable,GridCacheDeployable,GridCacheVersionable,Message
- Direct Known Subclasses:
GridDhtLockRequest,GridNearLockRequest
public class GridDistributedLockRequest extends GridDistributedBaseMessage
Lock request message.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intidxKey-bytes index.-
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 GridDistributedLockRequest()Empty constructor.GridDistributedLockRequest(int cacheId, UUID nodeId, @Nullable GridCacheVersion nearXidVer, long threadId, IgniteUuid futId, GridCacheVersion lockVer, boolean isInTx, boolean isRead, TransactionIsolation isolation, boolean isInvalidate, long timeout, int keyCnt, int txSize, boolean skipStore, boolean keepBinary, boolean addDepInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddKeyBytes(KeyCacheObject key, boolean retVal)Adds a key.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()booleaninTx()booleanisInvalidate()TransactionIsolationisolation()booleankeepBinary()voidkeepBinary(boolean keepBinary)List<KeyCacheObject>keys()IgniteLoggermessageLogger(GridCacheSharedContext<?,?> ctx)GridCacheVersionnearXidVersion()UUIDnodeId()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.booleanreturnValue(int idx)booleanskipStore()booleanstoreUsed()voidstoreUsed(boolean storeUsed)longthreadId()longtimeout()StringtoString()booleantxRead()inttxSize()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, error, 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
-
GridDistributedLockRequest
public GridDistributedLockRequest()
Empty constructor.
-
GridDistributedLockRequest
public GridDistributedLockRequest(int cacheId, UUID nodeId, @Nullable @Nullable GridCacheVersion nearXidVer, long threadId, IgniteUuid futId, GridCacheVersion lockVer, boolean isInTx, boolean isRead, TransactionIsolation isolation, boolean isInvalidate, long timeout, int keyCnt, int txSize, boolean skipStore, boolean keepBinary, boolean addDepInfo)- Parameters:
cacheId- Cache ID.nodeId- Node ID.nearXidVer- Near transaction ID.threadId- Thread ID.futId- Future ID.lockVer- Cache version.isInTx-Trueif implicit transaction lock.isRead- Indicates whether implicit lock is for read or write operation.isolation- Transaction isolation.isInvalidate- Invalidation flag.timeout- Lock timeout.keyCnt- Number of keys.txSize- Expected transaction size.skipStore- Skip store flag.addDepInfo- Deployment info flag.
-
-
Method Detail
-
nodeId
public UUID nodeId()
- Returns:
- Node ID.
-
nearXidVersion
public GridCacheVersion nearXidVersion()
- Returns:
- Near transaction ID.
-
threadId
public long threadId()
- Returns:
- Owner node thread ID.
-
futureId
public IgniteUuid futureId()
- Returns:
- Future ID.
-
inTx
public boolean inTx()
- Returns:
Trueif implicit transaction lock.
-
isInvalidate
public boolean isInvalidate()
- Returns:
- Invalidate flag.
-
txRead
public boolean txRead()
- Returns:
Trueif lock is implicit and for a read operation.
-
returnValue
public boolean returnValue(int idx)
- Parameters:
idx- Key index.- Returns:
- Flag indicating whether a value should be returned.
-
skipStore
public boolean skipStore()
- Returns:
- Skip store flag.
-
keepBinary
public void keepBinary(boolean keepBinary)
- Parameters:
keepBinary- Keep binary flag.
-
keepBinary
public boolean keepBinary()
- Returns:
- Keep binary.
-
storeUsed
public boolean storeUsed()
- Returns:
- Flag indicating whether transaction use cache store.
-
storeUsed
public void storeUsed(boolean storeUsed)
- Parameters:
storeUsed- Store used value.
-
isolation
public TransactionIsolation isolation()
- Returns:
- Transaction isolation or null if not in transaction.
-
txSize
public int txSize()
- Returns:
- Tx size.
-
addKeyBytes
public void addKeyBytes(KeyCacheObject key, boolean retVal)
Adds a key.- Parameters:
key- Key.retVal- Flag indicating whether value should be returned.
-
keys
public List<KeyCacheObject> keys()
- Returns:
- Unmarshalled keys.
-
partition
public int partition()
- Overrides:
partitionin classGridCacheMessage- Returns:
- Partition ID this message is targeted to or
-1if it cannot be determined.
-
timeout
public long timeout()
- Returns:
- Max lock wait time.
-
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-- 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.- 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
-
-