public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements IgniteTxLocalEx
| Modifier and Type | Class and Description |
|---|---|
protected class |
IgniteTxLocalAdapter.FinishClosure<T>
Post-lock closure.
|
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 IgniteTxLocalState |
txState |
cctx, concurrency, endVer, implicit, internal, invalidate, isDone, isolation, loc, log, needRetVal, nodeId, onePhaseCommit, startTime, startVer, storeEnabled, subjId, syncMode, taskName, taskNameHash, threadId, timeout, topVer, transform, txNodes, txSize, writeVer, xidVer| Modifier | Constructor and Description |
|---|---|
protected |
IgniteTxLocalAdapter()
Empty constructor required for
Externalizable. |
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,
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,
javax.cache.expiry.ExpiryPolicy expiryPlc) |
boolean |
activeCachesDeploymentEnabled() |
void |
activeCachesDeploymentEnabled(boolean depEnabled) |
protected void |
addActiveCache(GridCacheContext cacheCtx)
Adds cache to the list of active caches in transaction.
|
protected IgniteTxEntry |
addEntry(GridCacheOperation op,
CacheObject val,
javax.cache.processor.EntryProcessor entryProcessor,
Object[] invokeArgs,
GridCacheEntryEx entry,
javax.cache.expiry.ExpiryPolicy expiryPlc,
CacheEntryPredicate[] filter,
boolean filtersSet,
long drTtl,
long drExpireTime,
GridCacheVersion drVer,
boolean skipStore,
boolean keepBinary) |
Collection<IgniteTxEntry> |
allEntries() |
Collection<GridCacheVersion> |
alternateVersions() |
protected void |
checkValid()
Checks transaction expiration.
|
void |
commit()
Commits this transaction by initiating
two-phase-commit process. |
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() |
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() |
<K,V> IgniteInternalFuture<Map<K,V>> |
getAllAsync(GridCacheContext cacheCtx,
AffinityTopologyVersion entryTopVer,
Collection<KeyCacheObject> keys,
boolean deserializeBinary,
boolean skipVals,
boolean keepCacheObjects,
boolean skipStore,
boolean needVer) |
boolean |
hasInterceptor() |
boolean |
hasWriteKey(IgniteTxKey key) |
void |
implicitSingleResult(GridCacheReturn ret) |
boolean |
init()
Initializes read map.
|
protected void |
initResult()
Creates result instance.
|
<K,V> IgniteInternalFuture<GridCacheReturn> |
invokeAsync(GridCacheContext cacheCtx,
AffinityTopologyVersion entryTopVer,
K key,
javax.cache.processor.EntryProcessor<K,V,Object> entryProcessor,
Object... invokeArgs) |
<K,V,T> IgniteInternalFuture<GridCacheReturn> |
invokeAsync(GridCacheContext cacheCtx,
AffinityTopologyVersion entryTopVer,
Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,Object>> map,
Object... invokeArgs) |
boolean |
isStarted() |
IgniteInternalFuture<Void> |
loadMissing(GridCacheContext cacheCtx,
AffinityTopologyVersion topVer,
boolean readThrough,
boolean async,
Collection<KeyCacheObject> keys,
boolean skipVals,
boolean needVer,
boolean keepBinary,
GridInClosure3<KeyCacheObject,Object,GridCacheVersion> c) |
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.
|
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.
|
void |
prepare()
Prepare state.
|
<K,V> IgniteInternalFuture<GridCacheReturn> |
putAllAsync(GridCacheContext cacheCtx,
AffinityTopologyVersion entryTopVer,
Map<? extends K,? extends V> map,
boolean retval) |
IgniteInternalFuture<?> |
putAllDrAsync(GridCacheContext cacheCtx,
Map<KeyCacheObject,GridCacheDrInfo> drMap) |
<K,V> IgniteInternalFuture<GridCacheReturn> |
putAsync(GridCacheContext cacheCtx,
AffinityTopologyVersion entryTopVer,
K key,
V val,
boolean retval,
CacheEntryPredicate filter) |
Collection<IgniteTxEntry> |
readEntries() |
Map<IgniteTxKey,IgniteTxEntry> |
readMap() |
Set<IgniteTxKey> |
readSet() |
<K,V> IgniteInternalFuture<GridCacheReturn> |
removeAllAsync(GridCacheContext cacheCtx,
AffinityTopologyVersion entryTopVer,
Collection<? extends K> keys,
boolean retval,
CacheEntryPredicate filter,
boolean singleRmv) |
IgniteInternalFuture<?> |
removeAllDrAsync(GridCacheContext cacheCtx,
Map<KeyCacheObject,GridCacheVersion> drMap) |
Collection<GridCacheVersion> |
rolledbackVersions() |
void |
seal()
Seals transaction for updates.
|
void |
sendTransformedValues(boolean snd) |
void |
tmFinish(boolean commit)
Commits transaction to transaction manager.
|
String |
toString() |
IgniteTxState |
txState() |
protected void |
updateExplicitVersion(IgniteTxEntry txEntry,
GridCacheEntryEx entry)
Updates explicit version for tx entry based on current entry lock owner.
|
void |
userCommit() |
void |
userPrepare() |
void |
userRollback() |
Collection<IgniteTxEntry> |
writeEntries() |
Map<IgniteTxKey,IgniteTxEntry> |
writeMap() |
Set<IgniteTxKey> |
writeSet() |
addInvalidPartition, applyTransformClosures, batchStoreCommit, checkInternal, close, colocated, commitVersion, commitVersion, concurrency, conflictResolve, currentPrepareFuture, dht, done, endVersion, equals, errorWhenCommitting, evictNearEntry, finalizationStatus, finishFuture, hashCode, hasTransforms, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isNearLocallyMapped, isolation, isRollbackOnly, isSystemInvalidate, isWriteToStoreFromDhtValid, local, localResult, log, markFinalizing, markPreparing, near, nearXidVersion, needReturnValue, needReturnValue, needsCompletedVersions, nodeId, onePhaseCommit, onePhaseCommit, onRemap, optimistic, optimisticLockEntries, otherNodeId, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, proxy, readCommitted, readExternal, readResolve, remainingTime, repeatableRead, replicated, resolveTaskName, serializable, sessionEnd, setRollbackOnly, size, startTime, state, state, state, storeEnabled, storeEnabled, storeUsed, subjectId, syncMode, syncMode, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, timeoutException, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, transactionNodes, uncommit, updateNearCache, user, writeExternal, writeVersion, writeVersion, xid, xidVersionaddMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, readExternalMeta, removeAllMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetafinalize, getClass, notify, notifyAll, wait, wait, waitfinishaddInvalidPartition, addMeta, close, colocated, commitAsync, commitVersion, commitVersion, concurrency, currentPrepareFuture, dht, done, endVersion, errorWhenCommitting, finishFuture, hasTransforms, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, local, localResult, markFinalizing, markPreparing, meta, near, nearXidVersion, needsCompletedVersions, nodeId, onePhaseCommit, onRemap, optimistic, optimisticLockEntries, otherNodeId, ownedVersion, ownsLock, ownsLockUnsafe, pessimistic, prepareAsync, proxy, readCommitted, remainingTime, removeMeta, repeatableRead, replicated, rollback, rollbackAsync, serializable, setRollbackOnly, size, startTime, state, state, storeEnabled, storeUsed, subjectId, syncMode, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, topologyVersion, topologyVersion, topologyVersionSnapshot, transactionNodes, 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 IgniteTxLocalAdapter()
Externalizable.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)
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 IgniteTxState 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)
depEnabled - 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 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 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 IgniteInternalFuture<Void> loadMissing(GridCacheContext cacheCtx, AffinityTopologyVersion topVer, boolean readThrough, boolean async, Collection<KeyCacheObject> keys, boolean skipVals, boolean needVer, boolean keepBinary, GridInClosure3<KeyCacheObject,Object,GridCacheVersion> c)
loadMissing in interface IgniteTxLocalExcacheCtx - Cache context.readThrough - Read through flag.async - if True, then loading will happen in a separate thread.keys - Keys.skipVals - Skip values flag.needVer - If true version is required for loaded values.c - Closure to be applied for loaded values.True value if loading took place.public GridCacheVersion minVersion()
minVersion in interface IgniteTxLocalExpublic void userPrepare()
throws IgniteCheckedException
IgniteCheckedException - If prepare step failed.public void commit()
throws IgniteCheckedException
two-phase-commit process.commit in interface IgniteInternalTxIgniteCheckedException - If commit failed.public void prepare()
throws IgniteCheckedException
prepare in interface IgniteInternalTxIgniteCheckedException - If failed.protected 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)
commit - If true commits transaction, otherwise rollbacks.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()
throws IgniteCheckedException
userRollback in interface IgniteTxLocalExIgniteCheckedException - If rollback failed.protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx, IgniteTxKey key, @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.public <K,V> IgniteInternalFuture<Map<K,V>> getAllAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, Collection<KeyCacheObject> keys, boolean deserializeBinary, boolean skipVals, boolean keepCacheObjects, boolean skipStore, boolean needVer)
getAllAsync in interface IgniteTxLocalExcacheCtx - Cache context.keys - Keys to get.deserializeBinary - Deserialize binary flag.skipVals - Skip values flag.keepCacheObjects - Keep cache objectsskipStore - Skip store flag.public <K,V> IgniteInternalFuture<GridCacheReturn> putAllAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, Map<? extends K,? extends V> map, boolean retval)
putAllAsync in interface IgniteTxLocalExcacheCtx - Cache context.map - Map to put.retval - Flag indicating whether a value should be returned.public <K,V> IgniteInternalFuture<GridCacheReturn> putAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, K key, V val, boolean retval, CacheEntryPredicate filter)
putAsync in interface IgniteTxLocalExcacheCtx - Cache context.key - Key.val - Value.retval - Return value flag.filter - Filter.public <K,V> IgniteInternalFuture<GridCacheReturn> invokeAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, K key, javax.cache.processor.EntryProcessor<K,V,Object> entryProcessor, Object... invokeArgs)
invokeAsync in interface IgniteTxLocalExcacheCtx - Cache context.key - Key.entryProcessor - Entry processor.invokeArgs - Optional arguments for entry processor.public IgniteInternalFuture<?> putAllDrAsync(GridCacheContext cacheCtx, Map<KeyCacheObject,GridCacheDrInfo> drMap)
putAllDrAsync in interface IgniteTxLocalExcacheCtx - Cache context.drMap - DR map to put.public <K,V,T> IgniteInternalFuture<GridCacheReturn> invokeAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, @Nullable Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,Object>> map, Object... invokeArgs)
invokeAsync in interface IgniteTxLocalExcacheCtx - Cache context.map - Entry processors map.invokeArgs - Optional arguments for entry processor.public IgniteInternalFuture<?> removeAllDrAsync(GridCacheContext cacheCtx, Map<KeyCacheObject,GridCacheVersion> drMap)
removeAllDrAsync in interface IgniteTxLocalExcacheCtx - Cache context.drMap - DR map.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.public <K,V> IgniteInternalFuture<GridCacheReturn> removeAllAsync(GridCacheContext cacheCtx, @Nullable AffinityTopologyVersion entryTopVer, Collection<? extends K> keys, boolean retval, CacheEntryPredicate filter, boolean singleRmv)
removeAllAsync in interface IgniteTxLocalExcacheCtx - Cache context.keys - Keys to remove.retval - Flag indicating whether a value should be returned.filter - Filter.singleRmv - True for single key remove operation (Cache.remove(Object).public boolean init()
True if transaction was successfully started.protected final void addActiveCache(GridCacheContext cacheCtx) throws IgniteCheckedException
cacheCtx - Cache context to add.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.public Collection<GridCacheVersion> alternateVersions()
alternateVersions in interface IgniteInternalTxprotected final 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)
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 String toString()
toString in class IgniteTxAdapterpublic long entryTtl(IgniteTxKey key)
key - Key.public long entryExpireTime(IgniteTxKey key)
key - Key.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.8.0 Release Date : December 5 2016