public class GridCacheMvccCandidate extends Object implements Externalizable, Comparable<GridCacheMvccCandidate>, CacheLockCandidates
Constructor and Description |
---|
GridCacheMvccCandidate()
Empty constructor required by
Externalizable . |
GridCacheMvccCandidate(GridCacheEntryEx parent,
UUID nodeId,
UUID otherNodeId,
GridCacheVersion otherVer,
long threadId,
GridCacheVersion ver,
boolean loc,
boolean reentry,
boolean tx,
boolean singleImplicit,
boolean nearLoc,
boolean dhtLoc,
GridCacheVersion serOrder,
boolean read) |
public GridCacheMvccCandidate()
Externalizable
.public GridCacheMvccCandidate(GridCacheEntryEx parent, UUID nodeId, @Nullable UUID otherNodeId, @Nullable GridCacheVersion otherVer, long threadId, GridCacheVersion ver, boolean loc, boolean reentry, boolean tx, boolean singleImplicit, boolean nearLoc, boolean dhtLoc, @Nullable GridCacheVersion serOrder, boolean read)
parent
- Parent entry.nodeId
- Requesting node ID.otherNodeId
- Near node ID.otherVer
- Other version.threadId
- Requesting thread ID.ver
- Cache version.loc
- True
if the lock is local.reentry
- True
if candidate is for reentry.tx
- Transaction flag.singleImplicit
- Single-key-implicit-transaction flag.nearLoc
- Near-local flag.dhtLoc
- DHT local flag.serOrder
- Version for serializable transactions ordering.read
- Read lock flag.public short flags()
public <V> GridCacheEntryEx parent()
public AffinityTopologyVersion topologyVersion()
public void topologyVersion(AffinityTopologyVersion topVer)
topVer
- Topology version.public GridCacheMvccCandidate reenter()
@Nullable public GridCacheMvccCandidate unenter()
null
.public void parent(GridCacheEntryEx parent)
parent
- Sets locks parent entry.public UUID nodeId()
public UUID otherNodeId()
public void otherNodeId(UUID otherNodeId)
otherNodeId
- Near or DHT node ID.public Collection<ClusterNode> mappedDhtNodes()
public Collection<ClusterNode> mappedNearNodes()
public void mappedNodeIds(Collection<ClusterNode> mappedDhtNodes, Collection<ClusterNode> mappedNearNodes)
mappedDhtNodes
- Mapped DHT node IDs.public void removeMappedNode(ClusterNode node)
node
- Node to remove.public GridCacheVersion otherVersion()
public boolean otherVersion(GridCacheVersion otherVer)
otherVer
is near local candidate version.
For near local candidates otherVer
is dht mapped candidate version.otherVer
- Alternative candidate version.True
if other version was set, false
if other version is already set.public boolean ownerVersion(GridCacheVersion ownerVer)
ownerVer
- Version of owned candidate by the moment this candidate was added.True
if owned version was set, false
otherwise.@Nullable public GridCacheVersion ownerVersion()
null
if there were no owned candidates.public long threadId()
Thread.getId()
public GridCacheVersion version()
public boolean local()
True
if lock is local.public boolean tx()
True
if transaction flag is set.public boolean singleImplicit()
True
if implicit transaction.public boolean nearLocal()
public boolean dhtLocal()
public boolean serializable()
@Nullable public GridCacheVersion serializableOrder()
public boolean read()
public boolean reentry()
True
if this candidate is a reentry.public void setReentry()
public boolean ready()
public void setReady()
public boolean used()
True
if lock was released.public void setUsed()
public boolean removed()
public void setRemoved()
public boolean owner()
True
if is or was an owner.public void setOwner()
@Nullable public GridCacheMvccCandidate previous()
public void previous(GridCacheMvccCandidate prev)
prev
- Lock that comes before in the same thread.public GridCacheMvccCandidate next()
public void next(GridCacheMvccCandidate next)
next
- Next candidate in this thread.public IgniteTxKey key()
public GridCacheMvccCandidate candidate(int idx)
candidate
in interface CacheLockCandidates
idx
- Candidate index.public int size()
size
in interface CacheLockCandidates
public boolean hasCandidate(GridCacheVersion ver)
hasCandidate
in interface CacheLockCandidates
ver
- Candidate version.True
if contains candidate with given version.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public int compareTo(GridCacheMvccCandidate o)
compareTo
in interface Comparable<GridCacheMvccCandidate>
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017