public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements IgniteTxLocalEx
| Modifier and Type | Class and Description |
|---|---|
protected class |
IgniteTxLocalAdapter.PLC1<T>
Post-lock closure alias.
|
protected class |
IgniteTxLocalAdapter.PLC2<T>
Post-lock closure alias.
|
protected class |
IgniteTxLocalAdapter.PMC<T>
Post-lock closure alias.
|
protected class |
IgniteTxLocalAdapter.PostLockClosure1<T>
Post-lock closure.
|
protected class |
IgniteTxLocalAdapter.PostLockClosure2<T>
Post-lock closure.
|
protected class |
IgniteTxLocalAdapter.PostMissClosure<T>
Post-lock closure.
|
GridMetadataAwareAdapter.EntryKeyIgniteInternalTx.FinalizationStatus| Modifier and Type | Field and Description |
|---|---|
protected static AtomicReferenceFieldUpdater<IgniteTxLocalAdapter,Throwable> |
COMMIT_ERR_UPD
Commit error updater.
|
protected Throwable |
commitErr
Commit error.
|
protected static AtomicIntegerFieldUpdater<IgniteTxLocalAdapter> |
DONE_FLAG_UPD
Done flag updater.
|
protected int |
doneFlag
Flag indicating with TM commit happened.
|
protected GridCacheReturn |
implicitRes
Implicit transaction result.
|
protected GridCacheVersion |
minVer
Minimal version encountered (either explicit lock or XID of this transaction).
|
protected boolean |
qryEnlisted |
protected CacheWriteSynchronizationMode |
syncMode |
protected IgniteTxLocalState |
txState |
cctx, concurrency, consistentIdMapper, deploymentLdrId, implicit, internal, invalidate, isDone, isolation, loc, log, mvccSnapshot, needRetVal, nodeId, onePhaseCommit, startTime, startTimeNanos, storeEnabled, subjId, taskName, taskNameHash, threadId, timeout, topVer, txNodes, txSize, writeVer, xidVer| Modifier | Constructor and Description |
|---|---|
protected |
IgniteTxLocalAdapter(GridCacheSharedContext cctx,
GridCacheVersion xidVer,
boolean implicit,
boolean implicitSingle,
boolean sys,
byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
boolean invalidate,
boolean storeEnabled,
boolean onePhaseCommit,
int txSize,
@Nullable UUID subjId,
int taskNameHash) |
| Modifier and Type | Method and Description |
|---|---|
protected IgniteCacheExpiryPolicy |
accessPolicy(GridCacheContext cacheCtx,
Collection<KeyCacheObject> keys) |
protected IgniteCacheExpiryPolicy |
accessPolicy(GridCacheContext ctx,
IgniteTxKey key,
@Nullable javax.cache.expiry.ExpiryPolicy expiryPlc) |
boolean |
activeCachesDeploymentEnabled() |
void |
activeCachesDeploymentEnabled(boolean depEnabled) |
void |
addActiveCache(GridCacheContext cacheCtx,
boolean recovery)
Adds cache to the list of active caches in transaction.
|
IgniteTxEntry |
addEntry(GridCacheOperation op,
@Nullable CacheObject val,
@Nullable javax.cache.processor.EntryProcessor entryProcessor,
Object[] invokeArgs,
GridCacheEntryEx entry,
@Nullable javax.cache.expiry.ExpiryPolicy expiryPlc,
CacheEntryPredicate[] filter,
boolean filtersSet,
long drTtl,
long drExpireTime,
@Nullable GridCacheVersion drVer,
boolean skipStore,
boolean keepBinary,
boolean addReader) |
protected void |
addInvokeResult(IgniteTxEntry txEntry,
CacheObject cacheVal,
GridCacheReturn ret,
GridCacheVersion ver) |
Collection<IgniteTxEntry> |
allEntries() |
Collection<GridCacheVersion> |
alternateVersions() |
void |
calculatePartitionUpdateCounters()
Calculates partition update counters for current transaction.
|
protected void |
checkValid()
Checks transaction expiration.
|
protected void |
checkValid(boolean checkTimeout)
Checks transaction expiration.
|
protected boolean |
commitAfterLock() |
Throwable |
commitError() |
void |
commitError(Throwable e) |
Collection<GridCacheVersion> |
committedVersions() |
GridCacheVersion |
completedBase() |
void |
completedVersions(GridCacheVersion completedBase,
Collection<GridCacheVersion> committedVers,
Collection<GridCacheVersion> rolledbackVers) |
boolean |
empty() |
@Nullable IgniteTxEntry |
entry(IgniteTxKey key) |
protected GridCacheEntryEx |
entryEx(GridCacheContext cacheCtx,
IgniteTxKey key)
Gets cache entry for given key.
|
protected GridCacheEntryEx |
entryEx(GridCacheContext cacheCtx,
IgniteTxKey key,
AffinityTopologyVersion topVer)
Gets cache entry for given key and topology version.
|
long |
entryExpireTime(IgniteTxKey key) |
long |
entryTtl(IgniteTxKey key) |
UUID |
eventNodeId() |
boolean |
hasInterceptor() |
boolean |
hasWriteKey(IgniteTxKey key) |
void |
implicitSingleResult(GridCacheReturn ret) |
boolean |
init()
Initializes read map.
|
protected void |
initResult()
Creates result instance.
|
boolean |
isStarted() |
void |
markQueryEnlisted()
Marks that there are entries, enlisted by query.
|
Collection<UUID> |
masterNodeIds() |
GridCacheVersion |
minVersion()
Gets minimum version present in transaction.
|
boolean |
onOwnerChanged(GridCacheEntryEx entry,
GridCacheMvccCandidate owner)
Callback invoked whenever there is a lock that has been acquired
by this transaction for any of the participating entries.
|
UUID |
originatingNodeId()
Gets node ID which directly started this transaction.
|
Map<Integer,Set<Integer>> |
partsMap() |
@Nullable GridTuple<CacheObject> |
peek(GridCacheContext cacheCtx,
boolean failFast,
KeyCacheObject key) |
protected void |
postLockWrite(GridCacheContext cacheCtx,
Iterable<KeyCacheObject> keys,
GridCacheReturn ret,
boolean rmv,
boolean retval,
boolean read,
long accessTtl,
CacheEntryPredicate[] filter,
boolean computeInvoke)
Post lock processing for put or remove.
|
boolean |
queryEnlisted() |
Collection<IgniteTxEntry> |
readEntries() |
Map<IgniteTxKey,IgniteTxEntry> |
readMap() |
Set<IgniteTxKey> |
readSet() |
Collection<GridCacheVersion> |
rolledbackVersions() |
void |
seal()
Seals transaction for updates.
|
void |
sendTransformedValues(boolean snd) |
CacheWriteSynchronizationMode |
syncMode() |
void |
syncMode(CacheWriteSynchronizationMode syncMode) |
void |
tmFinish(boolean commit,
boolean nodeStop,
boolean clearThreadMap)
Commits transaction to transaction manager.
|
String |
toString() |
void |
touchPartition(int cacheId,
int partId)
Remembers that particular cache partition was touched by current tx.
|
IgniteTxLocalState |
txState() |
protected void |
updateExplicitVersion(IgniteTxEntry txEntry,
GridCacheEntryEx entry)
Updates explicit version for tx entry based on current entry lock owner.
|
void |
userCommit() |
void |
userPrepare(@Nullable Collection<IgniteTxEntry> entries) |
void |
userRollback(boolean clearThreadMap) |
Collection<IgniteTxEntry> |
writeEntries() |
Map<IgniteTxKey,IgniteTxEntry> |
writeMap() |
Set<IgniteTxKey> |
writeSet() |
addInvalidPartition, applyTransformClosures, applyTxSizes, batchStoreCommit, chainState, checkInternal, colocated, commitVersion, commitVersion, concurrency, conflictResolve, context, currentPrepareFuture, dht, done, equals, errorWhenCommitting, evictNearEntry, finalizationStatus, finishFuture, hashCode, heuristicException, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, isWriteToStoreFromDhtValid, local, localResult, log, logTxFinishErrorSafe, markFinalizing, mvccSnapshot, mvccSnapshot, near, nearXidVersion, needReturnValue, needReturnValue, needsCompletedVersions, nodeId, onePhaseCommit, onePhaseCommit, optimistic, optimisticLockEntries, otherNodeId, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, readCommitted, recordStateChangedEvent, remainingTime, remote, repeatableRead, resolveTaskName, rollbackException, rollbackFuture, rollbackFuture, serializable, sessionEnd, setParentTx, setRollbackOnly, size, skipCompletedVersions, skipCompletedVersions, startTime, startTimeNanos, state, state, state, storeEnabled, storeEnabled, storeWriteThrough, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, timeoutException, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, transactionNodes, txCounters, uncommit, updateNearCache, user, writeVersion, writeVersion, xid, xidVersionaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, removeAllMeta, removeMeta, removeMeta, replaceMetafinalize, getClass, notify, notifyAll, wait, wait, waitlocalFinishaddInvalidPartition, addMeta, colocated, commitAsync, commitVersion, commitVersion, concurrency, currentPrepareFuture, dht, done, errorWhenCommitting, finalizationStatus, finishFuture, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, label, local, localResult, markFinalizing, meta, mvccSnapshot, mvccSnapshot, near, nearXidVersion, needsCompletedVersions, nodeId, onePhaseCommit, optimistic, optimisticLockEntries, otherNodeId, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, readCommitted, remainingTime, removeMeta, repeatableRead, rollbackAsync, salvageTx, serializable, setRollbackOnly, size, startTime, startTimeNanos, state, state, storeEnabled, storeWriteThrough, subjectId, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, txCounters, user, writeVersion, writeVersion, xid, xidVersionprotected static final AtomicReferenceFieldUpdater<IgniteTxLocalAdapter,Throwable> COMMIT_ERR_UPD
protected static final AtomicIntegerFieldUpdater<IgniteTxLocalAdapter> DONE_FLAG_UPD
protected GridCacheVersion minVer
protected volatile int doneFlag
protected volatile Throwable commitErr
protected GridCacheReturn implicitRes
@GridToStringInclude protected IgniteTxLocalState txState
protected CacheWriteSynchronizationMode syncMode
protected volatile boolean qryEnlisted
protected IgniteTxLocalAdapter(GridCacheSharedContext cctx, GridCacheVersion xidVer, boolean implicit, boolean implicitSingle, boolean sys, byte plc, TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, boolean invalidate, boolean storeEnabled, boolean onePhaseCommit, int txSize, @Nullable @Nullable UUID subjId, int taskNameHash)
cctx - Cache registry.xidVer - Transaction ID.implicit - True if transaction was implicitly started by the system,
false if it was started explicitly by user.implicitSingle - True if transaction is implicit with only one key.sys - System flag.plc - IO policy.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.txSize - Expected transaction size.public final CacheWriteSynchronizationMode syncMode()
public void syncMode(CacheWriteSynchronizationMode syncMode)
syncMode - Write synchronization mode.public IgniteTxLocalState txState()
txState in interface IgniteInternalTxprotected void initResult()
public UUID eventNodeId()
eventNodeId in interface IgniteInternalTxpublic UUID originatingNodeId()
originatingNodeId in interface IgniteInternalTxpublic boolean empty()
empty in interface IgniteInternalTxTrue if transaction is empty.public Collection<UUID> masterNodeIds()
masterNodeIds in interface IgniteInternalTxpublic Throwable commitError()
commitError in interface IgniteTxLocalExpublic void commitError(Throwable e)
commitError in interface IgniteInternalTxe - Commit error.public boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)
onOwnerChanged in interface IgniteInternalTxentry - Cache entry.owner - Lock candidate that won ownership of the lock.True if transaction cared about notification.public boolean activeCachesDeploymentEnabled()
activeCachesDeploymentEnabled in interface IgniteInternalTxtrue or false if the deployment is enabled or disabled for all active caches involved
in this transaction.public void activeCachesDeploymentEnabled(boolean depEnabled)
activeCachesDeploymentEnabled in interface IgniteInternalTxdepEnabled - Flag indicating whether deployment is enabled for caches from this transaction or not.public boolean isStarted()
isStarted in class IgniteTxAdapterTrue if transaction has at least one key enlisted.public boolean hasWriteKey(IgniteTxKey key)
hasWriteKey in interface IgniteInternalTxkey - Key to check.True if key is present.public Set<IgniteTxKey> readSet()
readSet in interface IgniteInternalTxpublic Set<IgniteTxKey> writeSet()
writeSet in interface IgniteInternalTxpublic Map<IgniteTxKey,IgniteTxEntry> readMap()
readMap in interface IgniteInternalTxpublic Map<IgniteTxKey,IgniteTxEntry> writeMap()
writeMap in interface IgniteInternalTxpublic Collection<IgniteTxEntry> allEntries()
allEntries in interface IgniteInternalTxpublic Collection<IgniteTxEntry> readEntries()
readEntries in interface IgniteInternalTxpublic Collection<IgniteTxEntry> writeEntries()
writeEntries in interface IgniteInternalTx@Nullable public @Nullable IgniteTxEntry entry(IgniteTxKey key)
entry in interface IgniteInternalTxkey - Key for the entry.public void seal()
seal in interface IgniteInternalTxpublic void implicitSingleResult(GridCacheReturn ret)
ret - Result.public boolean hasInterceptor()
True if transaction participates in a cache that has an interceptor configured.public void sendTransformedValues(boolean snd)
snd - True if values in tx entries should be replaced with transformed values and sent
to remote nodes.protected boolean commitAfterLock()
True if should be committed after lock is acquired.@Nullable public @Nullable GridTuple<CacheObject> peek(GridCacheContext cacheCtx, boolean failFast, KeyCacheObject key) throws GridCacheFilterFailedException
peek in interface IgniteInternalTxcacheCtx - Cache context.failFast - Fail-fast flag.key - Key to look up.GridCacheFilterFailedException - If filter failed and failFast is true.public GridCacheVersion minVersion()
minVersion in interface IgniteTxLocalExpublic void userPrepare(@Nullable
@Nullable Collection<IgniteTxEntry> entries)
throws IgniteCheckedException
entries - Entries to lock or null if use default IgniteInternalTx.optimisticLockEntries().IgniteCheckedException - If prepare step failed.public void calculatePartitionUpdateCounters()
throws IgniteTxRollbackCheckedException
IgniteTxRollbackCheckedExceptionprotected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key)
cacheCtx - Cache context.key - Key.protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key, AffinityTopologyVersion topVer)
cacheCtx - Cache context.key - Key.topVer - Topology version.public void userCommit()
throws IgniteCheckedException
userCommit in interface IgniteTxLocalExIgniteCheckedException - If commit failed.public void tmFinish(boolean commit,
boolean nodeStop,
boolean clearThreadMap)
throws IgniteCheckedException
commit - If true commits transaction, otherwise rollbacks.clearThreadMap - If true removes GridNearTxLocal from thread map.nodeStop - If true tx is cancelled on node stop.IgniteCheckedException - If failed.public void completedVersions(GridCacheVersion completedBase, Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers)
completedVersions in interface IgniteInternalTxcompletedVersions in class IgniteTxAdaptercompletedBase - Base for committed versions.committedVers - Committed transactions relative to base.rolledbackVers - Rolled back transactions relative to base.public GridCacheVersion completedBase()
public Collection<GridCacheVersion> committedVersions()
public Collection<GridCacheVersion> rolledbackVersions()
public void userRollback(boolean clearThreadMap)
throws IgniteCheckedException
userRollback in interface IgniteTxLocalExclearThreadMap - If true removes GridNearTxLocal from thread map.IgniteCheckedException - If rollback failed.protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx, IgniteTxKey key, @Nullable @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)
ctx - Cache context.key - Key.expiryPlc - Expiry policy.protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext cacheCtx, Collection<KeyCacheObject> keys)
cacheCtx - Cache context.keys - Keys.protected final void postLockWrite(GridCacheContext cacheCtx, Iterable<KeyCacheObject> keys, GridCacheReturn ret, boolean rmv, boolean retval, boolean read, long accessTtl, CacheEntryPredicate[] filter, boolean computeInvoke) throws IgniteCheckedException
cacheCtx - Context.keys - Keys.ret - Return value.rmv - True if remove.retval - Flag to return value or not.read - True if read.accessTtl - TTL for read operation.filter - Filter to check entries.computeInvoke - If true computes return value for invoke operation.IgniteCheckedException - If error.protected final void addInvokeResult(IgniteTxEntry txEntry, CacheObject cacheVal, GridCacheReturn ret, GridCacheVersion ver)
txEntry - Entry.cacheVal - Value.ret - Return value to update.ver - Entry version.public boolean init()
True if transaction was successfully started.public final void addActiveCache(GridCacheContext cacheCtx, boolean recovery) throws IgniteCheckedException
addActiveCache in class IgniteTxAdaptercacheCtx - Cache context to add.recovery - Recovery flag. See CacheOperationContext.setRecovery(boolean).IgniteCheckedException - If caches already enlisted in this transaction are not compatible with given
cache (e.g. they have different stores).protected void checkValid()
throws IgniteCheckedException
IgniteCheckedException - If transaction check failed.protected void checkValid(boolean checkTimeout)
throws IgniteCheckedException
checkTimeout - Whether timeout should be checked.IgniteCheckedException - If transaction check failed.public Collection<GridCacheVersion> alternateVersions()
alternateVersions in interface IgniteInternalTxpublic final IgniteTxEntry addEntry(GridCacheOperation op, @Nullable @Nullable CacheObject val, @Nullable @Nullable javax.cache.processor.EntryProcessor entryProcessor, Object[] invokeArgs, GridCacheEntryEx entry, @Nullable @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc, CacheEntryPredicate[] filter, boolean filtersSet, long drTtl, long drExpireTime, @Nullable @Nullable GridCacheVersion drVer, boolean skipStore, boolean keepBinary, boolean addReader)
op - Cache operation.val - Value.expiryPlc - Explicitly specified expiry policy.invokeArgs - Optional arguments for EntryProcessor.entryProcessor - Entry processor.entry - Cache entry.filter - Filter.filtersSet - True if filter should be marked as set.drTtl - DR TTL (if any).drExpireTime - DR expire time (if any).drVer - DR version.skipStore - Skip store flag.protected void updateExplicitVersion(IgniteTxEntry txEntry, GridCacheEntryEx entry) throws GridCacheEntryRemovedException
txEntry - Tx entry to update.entry - Entry.GridCacheEntryRemovedException - If entry was concurrently removed.public Map<Integer,Set<Integer>> partsMap()
public void touchPartition(int cacheId,
int partId)
touchPartition in interface IgniteTxLocalExcacheId - Cache id.partId - Partition id.public String toString()
toString in class IgniteTxAdapterpublic long entryTtl(IgniteTxKey key)
key - Key.public long entryExpireTime(IgniteTxKey key)
key - Key.public boolean queryEnlisted()
True if there are entries, enlisted by query.public void markQueryEnlisted()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021