public class GridNearTxLocal extends GridDhtTxLocalAdapter
IgniteTxLocalAdapter.FinishClosure<T>, IgniteTxLocalAdapter.PLC1<T>, IgniteTxLocalAdapter.PLC2<T>, IgniteTxLocalAdapter.PMC<T>, IgniteTxLocalAdapter.PostLockClosure1<T>, IgniteTxLocalAdapter.PostLockClosure2<T>, IgniteTxLocalAdapter.PostMissClosure<T>GridMetadataAwareAdapter.EntryKeyIgniteInternalTx.FinalizationStatusdhtMap, explicitLock, mapped, nearMapCOMMIT_ERR_UPD, commitErr, DONE_FLAG_UPD, doneFlag, implicitRes, minVer, needRetVal, txStatecctx, concurrency, endVer, implicit, internal, invalidate, isDone, isolation, loc, log, nodeId, onePhaseCommit, startTime, startVer, storeEnabled, subjId, syncMode, taskName, taskNameHash, threadId, timeout, topVer, transform, txNodes, txSize, writeVer, xidVer| Constructor and Description |
|---|
GridNearTxLocal()
Empty constructor required for
Externalizable. |
GridNearTxLocal(GridCacheSharedContext ctx,
boolean implicit,
boolean implicitSingle,
boolean sys,
byte plc,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
boolean storeEnabled,
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) |
void |
addKeyMapping(IgniteTxKey key,
ClusterNode node)
Adds key mapping to dht mapping.
|
protected IgniteInternalFuture<Boolean> |
addReader(long msgId,
GridDhtCacheEntry cached,
IgniteTxEntry entry,
AffinityTopologyVersion topVer)
Adds reader to cached entry.
|
protected void |
clearPrepareFuture(GridDhtTxPrepareFuture fut)
Removes previously created prepare future from atomic reference.
|
void |
close()
Ends the transaction.
|
boolean |
colocated() |
boolean |
colocatedLocallyMapped() |
void |
colocatedLocallyMapped(boolean colocatedLocallyMapped) |
IgniteInternalFuture<IgniteInternalTx> |
commitAsync()
Asynchronously commits this transaction by initiating
two-phase-commit process. |
IgniteInternalFuture<IgniteInternalTx> |
commitAsyncLocal()
Commits local part of colocated transaction.
|
IgniteInternalFuture<?> |
currentPrepareFuture() |
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.
|
boolean |
finish(boolean commit)
Finishes transaction (either commit or rollback).
|
boolean |
hasRemoteLocks() |
void |
hasRemoteLocks(boolean hasRemoteLocks) |
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) |
<K> IgniteInternalFuture<GridCacheReturn> |
lockAllAsync(GridCacheContext cacheCtx,
Collection<? extends K> keys,
boolean retval,
boolean read,
long accessTtl,
boolean skipStore,
boolean keepBinary) |
boolean |
markExplicit(UUID nodeId) |
void |
markForBackupCheck()
Marks transaction to check if commit on backup.
|
boolean |
near() |
protected IgniteUuid |
nearFutureId() |
boolean |
nearLocallyMapped() |
void |
nearLocallyMapped(boolean nearLocallyMapped) |
protected UUID |
nearNodeId() |
GridCacheVersion |
nearXidVersion() |
boolean |
needCheckBackup() |
boolean |
onNeedCheckBackup() |
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.
|
void |
onRemap(AffinityTopologyVersion topVer) |
Collection<IgniteTxEntry> |
optimisticLockEntries()
Gets a list of entries that needs to be locked on the next step of prepare stage of
optimistic transaction.
|
void |
optimisticLockEntries(Collection<IgniteTxEntry> optimisticLockEntries) |
boolean |
ownsLock(GridCacheEntryEx entry) |
boolean |
ownsLockUnsafe(GridCacheEntryEx entry) |
IgniteInternalFuture<?> |
prepareAsync()
Prepare stage.
|
IgniteInternalFuture<GridNearTxPrepareResponse> |
prepareAsyncLocal(Collection<IgniteTxEntry> reads,
Collection<IgniteTxEntry> writes,
Map<UUID,Collection<UUID>> txNodes,
boolean last)
Prepares next batch of entries in dht transaction.
|
boolean |
removeMapping(UUID nodeId) |
IgniteInternalFuture<IgniteInternalTx> |
rollbackAsync()
Asynchronously rollback this transaction.
|
IgniteInternalFuture<IgniteInternalTx> |
rollbackAsyncLocal()
Rolls back local part of colocated transaction.
|
protected void |
sendFinishReply(boolean commit,
Throwable err) |
String |
toString() |
protected void |
updateExplicitVersion(IgniteTxEntry txEntry,
GridCacheEntryEx entry)
Updates explicit version for tx entry based on current entry lock owner.
|
addEntry, addInvalidPartition, addLockTransactionNode, chainOnePhasePrepare, commitOnPrepare, explicitLock, explicitLock, lockTransactionNodes, mapExplicitLocks, nearOnOriginatingNode, nearOnOriginatingNode, needsCompletedVersions, pendingVersions, pendingVersions, rollbackactiveCachesDeploymentEnabled, activeCachesDeploymentEnabled, addActiveCache, addEntry, allEntries, alternateVersions, checkValid, commit, commitAfterLock, commitError, commitError, committedVersions, completedBase, completedVersions, empty, entry, entryExpireTime, entryTtl, eventNodeId, getAllAsync, hasInterceptor, hasWriteKey, implicitSingleResult, init, initResult, invokeAsync, invokeAsync, isStarted, masterNodeIds, minVersion, needReturnValue, needReturnValue, originatingNodeId, peek, postLockWrite, prepare, putAllAsync, putAllDrAsync, putAsync, readEntries, readMap, readSet, removeAllAsync, removeAllDrAsync, rolledbackVersions, seal, sendTransformedValues, tmFinish, txState, userCommit, userPrepare, userRollback, writeEntries, writeMap, writeSetapplyTransformClosures, batchStoreCommit, checkInternal, commitVersion, commitVersion, concurrency, conflictResolve, dht, done, endTime, 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, nodeId, onePhaseCommit, onePhaseCommit, onTimeout, optimistic, otherNodeId, ownedVersion, pessimistic, proxy, readCommitted, readExternal, readResolve, remainingTime, repeatableRead, replicated, resolveTaskName, serializable, sessionEnd, setRollbackOnly, size, startTime, state, state, storeEnabled, storeEnabled, storeUsed, subjectId, syncMode, syncMode, system, systemInvalidate, taskNameHash, threadId, timedOut, timeout, timeout, timeoutException, timeoutId, 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, waitaddMeta, commitVersion, commitVersion, concurrency, dht, done, endVersion, errorWhenCommitting, finishFuture, hasTransforms, implicit, implicitSingle, internal, invalidate, invalidPartitions, ioPolicy, isInvalidate, isolation, isRollbackOnly, isSystemInvalidate, local, localResult, markFinalizing, markPreparing, meta, nodeId, onePhaseCommit, optimistic, otherNodeId, ownedVersion, pessimistic, proxy, readCommitted, remainingTime, removeMeta, repeatableRead, replicated, 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, xidVersionendTime, onTimeout, timeoutIdpublic GridNearTxLocal()
Externalizable.public GridNearTxLocal(GridCacheSharedContext ctx, boolean implicit, boolean implicitSingle, boolean sys, byte plc, TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, boolean storeEnabled, int txSize, @Nullable UUID subjId, int taskNameHash)
ctx - Cache registry.implicit - Implicit flag.implicitSingle - Implicit with one key flag.sys - System flag.plc - IO policy.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.storeEnabled - Store enabled flag.txSize - Transaction size.subjId - Subject ID.taskNameHash - Task name hash code.public boolean near()
near in interface IgniteInternalTxnear in class IgniteTxAdapterTrue if near transaction.public boolean colocated()
colocated in interface IgniteInternalTxcolocated in class IgniteTxAdapterTrue if dht colocated transaction.public GridCacheVersion nearXidVersion()
nearXidVersion in interface IgniteInternalTxnearXidVersion in class IgniteTxAdapterprotected UUID nearNodeId()
nearNodeId in class GridDhtTxLocalAdapterprotected IgniteUuid nearFutureId()
nearFutureId in class GridDhtTxLocalAdapterprotected IgniteInternalFuture<Boolean> addReader(long msgId, GridDhtCacheEntry cached, IgniteTxEntry entry, AffinityTopologyVersion topVer)
addReader in class GridDhtTxLocalAdaptermsgId - Message ID.cached - Cached entry.entry - Transaction entry.topVer - Topology version.True if reader was added as a result of this call.protected void sendFinishReply(boolean commit,
@Nullable
Throwable err)
sendFinishReply in class GridDhtTxLocalAdaptercommit - Commit flag.err - Error, if any.protected void clearPrepareFuture(GridDhtTxPrepareFuture fut)
clearPrepareFuture in class GridDhtTxLocalAdapterfut - Expected future.public void markForBackupCheck()
public boolean onNeedCheckBackup()
public boolean needCheckBackup()
public boolean nearLocallyMapped()
True if transaction contains at least one near cache key mapped to the local node.public void nearLocallyMapped(boolean nearLocallyMapped)
nearLocallyMapped - True if transaction contains near key mapped to the local node.public boolean colocatedLocallyMapped()
True if transaction contains colocated key mapped to the local node.public void colocatedLocallyMapped(boolean colocatedLocallyMapped)
colocatedLocallyMapped - True if transaction contains colocated key mapped to the local node.public boolean ownsLockUnsafe(GridCacheEntryEx entry)
ownsLockUnsafe in interface IgniteInternalTxownsLockUnsafe in class IgniteTxAdapterentry - Entry to check.True if lock is owned.public boolean ownsLock(GridCacheEntryEx entry) throws GridCacheEntryRemovedException
ownsLock in interface IgniteInternalTxownsLock in class IgniteTxAdapterentry - Entry to check.True if lock is owned.GridCacheEntryRemovedException - If entry has been removed.public Collection<IgniteTxEntry> optimisticLockEntries()
optimisticLockEntries in interface IgniteInternalTxoptimisticLockEntries in class IgniteTxAdapterpublic void optimisticLockEntries(Collection<IgniteTxEntry> optimisticLockEntries)
optimisticLockEntries - Optimistic lock entries.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 IgniteTxLocalExloadMissing in class IgniteTxLocalAdaptercacheCtx - 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.protected void updateExplicitVersion(IgniteTxEntry txEntry, GridCacheEntryEx entry) throws GridCacheEntryRemovedException
updateExplicitVersion in class IgniteTxLocalAdaptertxEntry - Tx entry to update.entry - Entry.GridCacheEntryRemovedException - If entry was concurrently removed.public boolean removeMapping(UUID nodeId)
removeMapping in class GridDhtTxLocalAdapternodeId - Undo mapping.True if mapping was removed.public void addKeyMapping(IgniteTxKey key, ClusterNode node)
key - Key to add.node - Node this key mapped to.public boolean markExplicit(UUID nodeId)
nodeId - Node ID to mark with explicit lock.True if mapping was found.public boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)
onOwnerChanged in interface IgniteInternalTxonOwnerChanged in class IgniteTxLocalAdapterentry - Cache entry.owner - Lock candidate that won ownership of the lock.True if transaction cared about notification.public boolean finish(boolean commit)
throws IgniteCheckedException
finish in interface IgniteTxLocalExfinish in class GridDhtTxLocalAdaptercommit - True if commit, false if rollback.True if state has been changed.IgniteCheckedException - If finish failed.public IgniteInternalFuture<?> prepareAsync()
public IgniteInternalFuture<IgniteInternalTx> commitAsync()
two-phase-commit process.public IgniteInternalFuture<IgniteInternalTx> rollbackAsync()
public IgniteInternalFuture<GridNearTxPrepareResponse> prepareAsyncLocal(@Nullable Collection<IgniteTxEntry> reads, @Nullable Collection<IgniteTxEntry> writes, Map<UUID,Collection<UUID>> txNodes, boolean last)
reads - Read entries.writes - Write entries.txNodes - Transaction nodes mapping.last - True if this is last prepare request.public IgniteInternalFuture<IgniteInternalTx> commitAsyncLocal()
public IgniteInternalFuture<IgniteInternalTx> rollbackAsyncLocal()
public <K> IgniteInternalFuture<GridCacheReturn> lockAllAsync(GridCacheContext cacheCtx, Collection<? extends K> keys, boolean retval, boolean read, long accessTtl, boolean skipStore, boolean keepBinary)
K - Key type.cacheCtx - Cache context.keys - Keys.retval - Return value flag.read - Read flag.accessTtl - Access ttl.skipStore - Skip store flag.keepBinary - Keep binary flag.protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key)
entryEx in class IgniteTxLocalAdaptercacheCtx - Cache context.key - Key.protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key, AffinityTopologyVersion topVer)
entryEx in class IgniteTxLocalAdaptercacheCtx - Cache context.key - Key.topVer - Topology version.protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx, IgniteTxKey key, @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)
accessPolicy in class IgniteTxLocalAdapterctx - Cache context.key - Key.expiryPlc - Expiry policy.protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext cacheCtx, Collection<KeyCacheObject> keys)
accessPolicy in class IgniteTxLocalAdaptercacheCtx - Cache context.keys - Keys.public void close()
throws IgniteCheckedException
close in interface AutoCloseableclose in interface IgniteInternalTxclose in class IgniteTxAdapterIgniteCheckedException - If transaction could not be gracefully ended.@Nullable public IgniteInternalFuture<?> currentPrepareFuture()
currentPrepareFuture in interface IgniteInternalTxcurrentPrepareFuture in class IgniteTxAdapterpublic void onRemap(AffinityTopologyVersion topVer)
onRemap in interface IgniteInternalTxonRemap in class IgniteTxAdaptertopVer - New topology version.public void hasRemoteLocks(boolean hasRemoteLocks)
hasRemoteLocks - True if tx has remote locks acquired.public boolean hasRemoteLocks()
True if tx has remote locks acquired.public String toString()
toString in class GridDhtTxLocalAdapter
Follow @ApacheIgnite
Ignite Fabric : ver. 1.7.0 Release Date : August 1 2016