public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
Modifier and Type | Field and Description |
---|---|
protected AtomicLong |
globalAtomicCnt
Global atomic id counter.
|
protected static int |
THREAD_RESERVE_SIZE
Maxim number of atomic IDs for thread.
|
cctx, log
Constructor and Description |
---|
GridCacheMvccManager() |
context, isStopping, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStop, start, startInfo, stop, stop0, stopInfo, toString
protected static final int THREAD_RESERVE_SIZE
protected final AtomicLong globalAtomicCnt
protected void start0() throws IgniteCheckedException
start0
in class GridCacheSharedManagerAdapter
IgniteCheckedException
- If failed.protected void onKernalStart0(boolean reconnect) throws IgniteCheckedException
onKernalStart0
in class GridCacheSharedManagerAdapter
reconnect
- True
if manager restarted after client reconnect.IgniteCheckedException
- If failed.public void onKernalStop0(boolean cancel)
onKernalStop0
in class GridCacheSharedManagerAdapter
cancel
- Cancel flag.public GridCacheMvccCallback callback()
public Collection<GridCacheExplicitLockSpan> activeExplicitLocks()
public Collection<GridCacheFuture<?>> activeFutures()
public void removeExplicitNodeLocks(UUID leftNodeId, AffinityTopologyVersion topVer)
leftNodeId
- Left node ID.topVer
- Topology version.public void mapVersion(GridCacheVersion from, GridCacheVersion to)
from
- From version.to
- To version.public GridCacheVersion mappedVersion(GridCacheVersion from)
from
- Near version.public void onStop()
public void onDisconnected(IgniteFuture reconnectFut)
onDisconnected
in interface GridCacheSharedManager
onDisconnected
in class GridCacheSharedManagerAdapter
reconnectFut
- Reconnect future.public GridCacheVersion unmapVersion(GridCacheVersion from)
from
- From version.public boolean addAtomicFuture(long futId, GridCacheAtomicFuture<?> fut)
futId
- Future ID.fut
- Future.False
if future was forcibly completed with error.public Collection<GridCacheAtomicFuture<?>> atomicFutures()
public int atomicFuturesCount()
public Collection<org.apache.ignite.internal.processors.cache.GridCacheMvccManager.DataStreamerFuture> dataStreamerFutures()
@Nullable public IgniteInternalFuture<?> atomicFuture(long futId)
futId
- Future ID.@Nullable public IgniteInternalFuture<?> removeAtomicFuture(long futId)
futId
- Future ID.public void addFuture(GridCacheFuture<?> fut, IgniteUuid futId)
fut
- Future.futId
- Future ID.public GridFutureAdapter addDataStreamerFuture(AffinityTopologyVersion topVer)
topVer
- Topology version.public boolean addFuture(GridCacheMvccFuture<?> fut)
fut
- Future.True
if added.public void removeFuture(IgniteUuid futId)
futId
- Future ID.public boolean removeMvccFuture(GridCacheMvccFuture<?> fut)
fut
- Future to remove.True
if removed.@Nullable public GridCacheMvccFuture<?> mvccFuture(GridCacheVersion ver, IgniteUuid futId)
ver
- Lock ID.futId
- Future ID.@Nullable public Collection<GridCacheMvccFuture<?>> mvccFutures(GridCacheVersion ver)
ver
- Lock ID.@Nullable public GridCacheFuture future(IgniteUuid futId)
futId
- Future ID.public boolean isRemoved(GridCacheContext cacheCtx, GridCacheVersion ver)
cacheCtx
- Cache context.ver
- Lock version to check.True
if lock had been removed.public boolean addRemoved(GridCacheContext cacheCtx, GridCacheVersion ver)
cacheCtx
- Cache context.ver
- Obsolete entry version.True
if added.public Collection<IgniteTxKey> lockedKeys()
public Collection<IgniteTxKey> nearLockedKeys()
public Collection<GridCacheMvccCandidate> remoteCandidates()
DGC
.public Collection<GridCacheMvccCandidate> localCandidates()
DGC
.public boolean addNext(GridCacheContext cacheCtx, GridCacheMvccCandidate cand)
cacheCtx
- Cache context.cand
- Cache lock candidate to add.True
if added as a result of this operation,
false
if was previously added.public void contextReset()
public void addExplicitLock(long threadId, GridCacheMvccCandidate cand, AffinityTopologyVersion topVer)
threadId
- Thread ID.cand
- Candidate to add.topVer
- Topology version.public void removeExplicitLock(GridCacheMvccCandidate cand)
cand
- Candidate to remove.public boolean isLockedByThread(IgniteTxKey key, long threadId)
key
- Key to check.threadId
- Thread id. If -1, all threads will be checked.True
if locked by any or given thread (depending on threadId
value).public void markExplicitOwner(IgniteTxKey key, long threadId)
key
- Key.threadId
- Thread id.public GridCacheMvccCandidate removeExplicitLock(long threadId, IgniteTxKey key, @Nullable GridCacheVersion ver)
threadId
- Thread id.key
- Key.ver
- Optional version.@Nullable public GridCacheMvccCandidate explicitLock(long threadId, IgniteTxKey key)
threadId
- Thread id.key
- Key to look up.null
if
no such candidate.@Nullable public GridCacheMvccCandidate explicitLock(IgniteTxKey key, @Nullable GridCacheVersion ver)
key
- Key.ver
- Version.null
if no such candidate.@Nullable public AffinityTopologyVersion lastExplicitLockTopologyVersion(long threadId)
threadId
- Thread ID.public void printMemoryStats()
printMemoryStats
in interface GridCacheSharedManager
printMemoryStats
in class GridCacheSharedManagerAdapter
public IgniteInternalFuture<?> finishLocks(AffinityTopologyVersion topVer)
topVer
- Topology version.public Map<IgniteTxKey,Collection<GridCacheMvccCandidate>> unfinishedLocks(AffinityTopologyVersion topVer)
topVer
- Topology version.public IgniteInternalFuture<?> finishExplicitLocks(AffinityTopologyVersion topVer)
topVer
- Topology version to wait for.public IgniteInternalFuture<?> finishAtomicUpdates(AffinityTopologyVersion topVer)
topVer
- Topology version to finish.public IgniteInternalFuture<?> finishDataStreamerUpdates()
public IgniteInternalFuture<?> finishKeys(Collection<KeyCacheObject> keys, int cacheId, AffinityTopologyVersion topVer)
keys
- Key for which locks should be released.cacheId
- Cache ID.topVer
- Topology version.public void recheckPendingLocks()
public long nextAtomicId()
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017