Class TxLock
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.transactions.TxLock
-
- All Implemented Interfaces:
Serializable,Message
public class TxLock extends Object implements Message
Corresponds to oneGridCacheMvccCandidatefrom local MVCC candidates queue. There is one exclusion:TxLockinstance withOWNERSHIP_REQUESTEDcorresponds to lock request to remote node from near node that isn't primary node for key.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message
DIRECT_TYPE_SIZE
-
-
Constructor Summary
Constructors Constructor Description TxLock()Default constructor.TxLock(GridCacheVersion txId, UUID nearNodeId, long threadId, byte ownership)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancandiate()shortdirectType()Gets message type.bytefieldsCount()Gets fields count.UUIDnearNodeId()voidonAckReceived()Method called when ack message received.booleanowner()booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.booleanrequested()longthreadId()StringtoString()GridCacheVersiontxId()booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.
-
-
-
Constructor Detail
-
TxLock
public TxLock()
Default constructor.
-
TxLock
public TxLock(GridCacheVersion txId, UUID nearNodeId, long threadId, byte ownership)
- Parameters:
txId- Tx ID.nearNodeId- Near node ID.threadId- Thread ID.ownership- Ownership.
-
-
Method Detail
-
nearNodeId
public UUID nearNodeId()
- Returns:
- Near node ID.
-
txId
public GridCacheVersion txId()
- Returns:
- Transaction ID.
-
threadId
public long threadId()
- Returns:
- Thread ID.
-
owner
public boolean owner()
- Returns:
Trueif transaction hold lock on the key, otherwisefalse.
-
candiate
public boolean candiate()
- Returns:
Trueif there is MVCC candidate for this transaction and key, otherwisefalse.
-
requested
public boolean requested()
- Returns:
Trueif transaction requested lock for key from primary remote node but response isn't received because other transaction hold lock on the key.
-
writeTo
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
Writes this message to provided byte buffer.
-
readFrom
public boolean readFrom(ByteBuffer buf, MessageReader reader)
Reads this message from provided byte buffer.
-
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- Returns:
- Fields count.
-
onAckReceived
public void onAckReceived()
Method called when ack message received.- Specified by:
onAckReceivedin interfaceMessage
-
-