public class IgniteTxManager extends GridCacheSharedManagerAdapter
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFERRED_ONE_PHASE_COMMIT_ACK_REQUEST_TIMEOUT
One phase commit deferred ack request timeout.
|
cctx, diagnosticLog, log| Constructor and Description |
|---|
IgniteTxManager() |
| Modifier and Type | Method and Description |
|---|---|
Collection<IgniteInternalTx> |
activeTransactions() |
void |
addAlternateVersion(GridCacheVersion ver,
IgniteInternalTx tx) |
void |
addCommittedTx(IgniteInternalTx tx) |
boolean |
addCommittedTx(IgniteInternalTx tx,
GridCacheVersion xidVer,
GridCacheVersion nearXidVer) |
void |
addCommittedTxReturn(IgniteInternalTx tx,
GridCacheReturnCompletableWrapper ret) |
void |
addFuture(org.apache.ignite.internal.processors.cache.transactions.TxDeadlockDetection.TxDeadlockFuture fut) |
boolean |
addRolledbackTx(IgniteInternalTx tx) |
boolean |
addRolledbackTx(IgniteInternalTx tx,
GridCacheVersion xidVer) |
IgniteInternalFuture<?> |
awaitFinishAckAsync(UUID rmtNodeId,
long threadId)
Asynchronously waits for last finish request ack.
|
void |
beforeFinishRemote(UUID rmtNodeId,
long threadId)
Callback called by near finish future before sending near finish request to remote node.
|
void |
clearThreadMap(IgniteInternalTx tx) |
void |
commitIfPrepared(IgniteInternalTx tx,
Set<UUID> failedNodeIds)
Commits transaction in case when node started transaction failed, but all related
transactions were prepared (invalidates transaction if it is not fully prepared).
|
void |
commitTx(IgniteInternalTx tx)
Commits a transaction.
|
int |
completedVersionsSize() |
boolean |
deadlockDetectionEnabled() |
Collection<IgniteInternalFuture<?>> |
deadlockDetectionFutures() |
IgniteInternalFuture<TxDeadlock> |
detectDeadlock(IgniteInternalTx tx,
Set<IgniteTxKey> keys)
Performs deadlock detection for given keys.
|
void |
fastFinishTx(GridNearTxLocal tx,
boolean commit,
boolean clearThreadMap)
Fast finish transaction.
|
IgniteInternalFuture<?> |
finishAllTxs(IgniteInternalFuture<?> finishLocalTxsFuture,
AffinityTopologyVersion topVer)
Creates a future that will wait for finishing all tx updates on backups after all local transactions are finished.
|
IgniteInternalFuture<Boolean> |
finishLocalTxs(AffinityTopologyVersion topVer)
Creates a future that will wait for all ongoing transactions that maybe affected by topology update
to be finished.
|
void |
finishSyncDisabled(boolean finishSyncDisabled)
For test purposes only.
|
void |
finishTxOnRecovery(IgniteInternalTx tx,
boolean commit)
Commits or rolls back prepared transaction.
|
org.apache.ignite.internal.processors.cache.transactions.TxDeadlockDetection.TxDeadlockFuture |
future(long futId) |
GridCacheReturnCompletableWrapper |
getCommittedTxReturn(GridCacheVersion xidVer) |
int |
idMapSize() |
boolean |
inUserTx() |
IgniteTxLocalAdapter |
localTx() |
AffinityTopologyVersion |
lockedTopologyVersion(long threadId,
IgniteInternalTx ignore) |
boolean |
logTxRecords() |
GridCacheVersion |
mappedVersion(GridCacheVersion from) |
<T extends IgniteInternalTx> |
nearTx(GridCacheVersion txId) |
boolean |
needWaitTransaction(IgniteInternalTx tx,
AffinityTopologyVersion topVer) |
GridNearTxLocal |
newTx(boolean implicit,
boolean implicitSingle,
GridCacheContext sysCacheCtx,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
boolean storeEnabled,
int txSize,
String lb) |
<T extends IgniteInternalTx> |
onCreated(GridCacheContext cacheCtx,
T tx) |
void |
onDisconnected(IgniteFuture reconnectFut) |
void |
onFinishedRemote(UUID rmtNodeId,
long threadId)
Callback invoked when near finish response is received from remote node.
|
protected void |
onKernalStop0(boolean cancel) |
boolean |
onOwnerChanged(GridCacheEntryEx entry,
GridCacheMvccCandidate owner)
Callback invoked whenever a member of a transaction acquires
lock ownership.
|
boolean |
onStarted(IgniteInternalTx tx)
Transaction start callback (has to do with when any operation was
performed on this transaction).
|
void |
prepareTx(IgniteInternalTx tx,
Collection<IgniteTxEntry> entries)
Handles prepare stage.
|
void |
printMemoryStats()
Prints out memory stats to standard out.
|
IgniteInternalFuture<?> |
remoteTxFinishFuture(GridCacheVersion nearVer) |
void |
removeCommittedTx(IgniteInternalTx tx) |
void |
removeFuture(long futId) |
void |
removeTxReturn(GridCacheVersion xidVer) |
void |
resetContext()
Commit ended.
|
void |
resumeTx(GridNearTxLocal tx,
long threadId)
Resume transaction in current thread.
|
void |
rollbackOnTopologyChange(AffinityTopologyVersion topVer)
Rollback transactions blocking partition map exchange.
|
void |
rollbackTransactionsForCache(int cacheId) |
void |
rollbackTx(IgniteInternalTx tx,
boolean clearThreadMap,
boolean skipCompletedVers)
Rolls back a transaction.
|
void |
salvageTx(IgniteInternalTx tx)
Invalidates transaction.
|
void |
sendDeferredAckResponse(UUID nodeId,
GridCacheVersion ver) |
boolean |
setTxTopologyHint(AffinityTopologyVersion topVer) |
int |
slowTxWarnTimeout() |
void |
slowTxWarnTimeout(int slowTxWarnTimeout) |
protected void |
start0() |
void |
suspendTx(GridNearTxLocal tx)
Suspends transaction.
|
GridNearTxLocal |
threadLocalTx(GridCacheContext cctx) |
int |
threadMapSize() |
<T> T |
tx() |
<T extends IgniteInternalTx> |
tx(GridCacheVersion txId) |
IgniteInternalFuture<Boolean> |
txCommitted(GridCacheVersion xidVer) |
void |
txContext(IgniteInternalTx tx) |
GridCacheVersion |
txContextVersion()
Gets version of transaction in tx context or
null
if tx context is empty. |
IgniteTxHandler |
txHandler() |
IgniteInternalFuture<Boolean> |
txsPreparedOrCommitted(GridCacheVersion nearVer,
int txNum)
Checks if transactions with given near version ID was prepared or committed.
|
GridNearTxLocal |
userTx() |
IgnitePair<Collection<GridCacheVersion>> |
versions(GridCacheVersion min) |
context, isStopping, kernalStartInfo, kernalStopInfo, log, onKernalStop, onReconnected, start, startInfo, stop, stop0, stopInfo, toStringpublic static final int DEFERRED_ONE_PHASE_COMMIT_ACK_REQUEST_TIMEOUT
protected void onKernalStop0(boolean cancel)
onKernalStop0 in class GridCacheSharedManagerAdaptercancel - Cancel flag.protected void start0()
throws IgniteCheckedException
start0 in class GridCacheSharedManagerAdapterIgniteCheckedException - If failed.public void rollbackTransactionsForCache(int cacheId)
cacheId - Cache ID.public void rollbackOnTopologyChange(AffinityTopologyVersion topVer)
topVer - Initial exchange version.public void onDisconnected(IgniteFuture reconnectFut)
onDisconnected in interface GridCacheSharedManageronDisconnected in class GridCacheSharedManagerAdapterreconnectFut - Reconnect future.public IgniteTxHandler txHandler()
public void salvageTx(IgniteInternalTx tx)
tx - Transaction.public void printMemoryStats()
USE ONLY FOR MEMORY PROFILING DURING TESTS.
printMemoryStats in interface GridCacheSharedManagerprintMemoryStats in class GridCacheSharedManagerAdapterpublic int threadMapSize()
public int idMapSize()
public int completedVersionsSize()
public GridNearTxLocal newTx(boolean implicit, boolean implicitSingle, @Nullable GridCacheContext sysCacheCtx, TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, boolean storeEnabled, int txSize, @Nullable String lb)
implicit - True if transaction is implicit.implicitSingle - Implicit-with-single-key flag.concurrency - Concurrency.isolation - Isolation.timeout - transaction timeout.txSize - Expected transaction size.lb - Label.@Nullable public <T extends IgniteInternalTx> T onCreated(@Nullable GridCacheContext cacheCtx, T tx)
cacheCtx - Cache context.tx - Created transaction.public IgniteInternalFuture<Boolean> finishLocalTxs(AffinityTopologyVersion topVer)
TransactionConcurrency.PESSIMISTIC transactions with topology version
less or equal to topVer.
TransactionConcurrency.OPTIMISTIC transactions in PREPARING state with topology
version less or equal to topVer and having transaction key with entry that belongs to
one of partitions in parts.
topVer - Topology version.public IgniteInternalFuture<?> finishAllTxs(IgniteInternalFuture<?> finishLocalTxsFuture, AffinityTopologyVersion topVer)
finishLocalTxsFuture - Local transactions finish future.topVer - Topology version.public boolean needWaitTransaction(IgniteInternalTx tx, AffinityTopologyVersion topVer)
tx - Transaction.topVer - Exchange version.True if need wait transaction for exchange.public boolean onStarted(IgniteInternalTx tx)
tx - Started transaction.True if transaction is not in completed set.public GridCacheVersion mappedVersion(GridCacheVersion from)
from - Near version.public void addAlternateVersion(GridCacheVersion ver, IgniteInternalTx tx)
ver - Alternate version.tx - Transaction.@Nullable public IgniteTxLocalAdapter localTx()
public GridNearTxLocal threadLocalTx(GridCacheContext cctx)
cctx - Cache context.public <T> T tx()
@Nullable public AffinityTopologyVersion lockedTopologyVersion(long threadId, IgniteInternalTx ignore)
threadId - Thread ID.ignore - Transaction to ignore.public boolean setTxTopologyHint(@Nullable
AffinityTopologyVersion topVer)
topVer - Locked topology version.True if topology hint was set.@Nullable public GridNearTxLocal userTx()
public boolean inUserTx()
True if current thread is currently within transaction.@Nullable public <T extends IgniteInternalTx> T tx(GridCacheVersion txId)
txId - Transaction ID.@Nullable public <T extends IgniteInternalTx> T nearTx(GridCacheVersion txId)
txId - Transaction ID.public void prepareTx(IgniteInternalTx tx, @Nullable Collection<IgniteTxEntry> entries) throws IgniteCheckedException
tx - Transaction to prepare.entries - Entries to lock or null if use default IgniteInternalTx.optimisticLockEntries().IgniteCheckedException - If preparation failed.public IgnitePair<Collection<GridCacheVersion>> versions(GridCacheVersion min)
min - Minimum version.null, elements potentially empty,
but also never null.public Collection<IgniteInternalTx> activeTransactions()
public void removeCommittedTx(IgniteInternalTx tx)
tx - Tx to remove.public void addCommittedTx(IgniteInternalTx tx)
tx - Committed transaction.public void addCommittedTxReturn(IgniteInternalTx tx, GridCacheReturnCompletableWrapper ret)
tx - Committed transaction.public boolean addRolledbackTx(IgniteInternalTx tx)
tx - Committed transaction.public boolean addCommittedTx(IgniteInternalTx tx, GridCacheVersion xidVer, @Nullable GridCacheVersion nearXidVer)
tx - Tx.xidVer - Completed transaction version.nearXidVer - Optional near transaction ID.public boolean addRolledbackTx(IgniteInternalTx tx, GridCacheVersion xidVer)
tx - Tx.xidVer - Completed transaction version.public GridCacheReturnCompletableWrapper getCommittedTxReturn(GridCacheVersion xidVer)
xidVer - xidVer Completed transaction version.public void removeTxReturn(GridCacheVersion xidVer)
xidVer - xidVer Completed transaction version.public void commitTx(IgniteInternalTx tx) throws IgniteCheckedException
tx - Transaction to commit.IgniteCheckedException - If failed.public void rollbackTx(IgniteInternalTx tx, boolean clearThreadMap, boolean skipCompletedVers)
tx - Transaction to rollback.clearThreadMap - True if need remove tx from thread map.skipCompletedVers - True if tx should skip adding itself to completed versions map on finish.public void fastFinishTx(GridNearTxLocal tx, boolean commit, boolean clearThreadMap)
tx - Transaction to finish.commit - True if transaction is committed, false if rolled back.clearThreadMap - True if need remove tx from thread map.public void clearThreadMap(IgniteInternalTx tx)
tx - Transaction to clear.public boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner)
entry - Cache entry.owner - Candidate that won ownership.True if transaction was notified, false otherwise.public void beforeFinishRemote(UUID rmtNodeId, long threadId)
rmtNodeId - Remote node ID for which finish request is being sent.threadId - Near tx thread ID.public void onFinishedRemote(UUID rmtNodeId, long threadId)
rmtNodeId - Remote node ID from which response is received.threadId - Near tx thread ID.@Nullable public IgniteInternalFuture<?> awaitFinishAckAsync(UUID rmtNodeId, long threadId)
rmtNodeId - Remote node ID.threadId - Near tx thread ID.null if ack was received or future that will be completed when ack is received.public void finishSyncDisabled(boolean finishSyncDisabled)
finishSyncDisabled - True if finish sync should be disabled.public void txContext(IgniteInternalTx tx)
tx - Committing transaction.@Nullable public GridCacheVersion txContextVersion()
null
if tx context is empty.
This is a convenience method provided mostly for debugging.
public void resetContext()
public int slowTxWarnTimeout()
public void slowTxWarnTimeout(int slowTxWarnTimeout)
slowTxWarnTimeout - Slow tx warn timeout.@Nullable public IgniteInternalFuture<Boolean> txsPreparedOrCommitted(GridCacheVersion nearVer, int txNum)
nearVer - Near version ID.txNum - Number of transactions.null for success future.public IgniteInternalFuture<Boolean> txCommitted(GridCacheVersion xidVer)
xidVer - Version.public IgniteInternalFuture<?> remoteTxFinishFuture(GridCacheVersion nearVer)
nearVer - Near version.public void finishTxOnRecovery(IgniteInternalTx tx, boolean commit)
tx - Transaction.commit - Whether transaction should be committed or rolled back.public void commitIfPrepared(IgniteInternalTx tx, Set<UUID> failedNodeIds)
tx - Transaction.failedNodeIds - Failed nodes IDs.public boolean deadlockDetectionEnabled()
True if deadlock detection is enabled.public IgniteInternalFuture<TxDeadlock> detectDeadlock(IgniteInternalTx tx, Set<IgniteTxKey> keys)
tx - Target tx.keys - Keys.public void addFuture(org.apache.ignite.internal.processors.cache.transactions.TxDeadlockDetection.TxDeadlockFuture fut)
fut - Future.@Nullable public org.apache.ignite.internal.processors.cache.transactions.TxDeadlockDetection.TxDeadlockFuture future(long futId)
futId - Future ID.public void removeFuture(long futId)
futId - Future ID.public void sendDeferredAckResponse(UUID nodeId, GridCacheVersion ver)
nodeId - Node ID to send message to.ver - Version to ack.public Collection<IgniteInternalFuture<?>> deadlockDetectionFutures()
public void suspendTx(GridNearTxLocal tx) throws IgniteCheckedException
tx - Transaction to be suspended.IgniteCheckedException - If failed to suspend transaction.resumeTx(GridNearTxLocal, long),
GridNearTxLocal.suspend(),
GridNearTxLocal.resume()public void resumeTx(GridNearTxLocal tx, long threadId) throws IgniteCheckedException
tx - Transaction to be resumed.threadId - Thread id to restore.IgniteCheckedException - If failed to resume tx.suspendTx(GridNearTxLocal),
GridNearTxLocal.suspend(),
GridNearTxLocal.resume()public boolean logTxRecords()
TxRecord records should be logged to WAL.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018