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.
|
static IgniteProductVersion |
TX_DEADLOCK_DETECTION_SINCE
Version in which deadlock detection introduced.
|
cctx, 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 |
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)
Fast finish transaction.
|
void |
finishSyncDisabled(boolean finishSyncDisabled)
For test purposes only.
|
void |
finishTxOnRecovery(IgniteInternalTx tx,
boolean commit)
Commits or rolls back prepared transaction.
|
IgniteInternalFuture<Boolean> |
finishTxs(AffinityTopologyVersion topVer)
Creates a future that will wait for all ongoing transactions that maybe affected by topology update
to be finished.
|
org.apache.ignite.internal.processors.cache.transactions.TxDeadlockDetection.TxDeadlockFuture |
future(long futId) |
GridCacheReturnCompletableWrapper |
getCommittedTxReturn(GridCacheVersion xidVer) |
int |
idMapSize() |
boolean |
inUserTx() |
boolean |
isCompleted(IgniteInternalTx tx) |
<T> T |
localTx() |
IgniteInternalTx |
localTxx() |
AffinityTopologyVersion |
lockedTopologyVersion(long threadId,
IgniteInternalTx ignore) |
GridCacheVersion |
mappedVersion(GridCacheVersion from) |
<T extends IgniteInternalTx> |
nearTx(GridCacheVersion txId) |
boolean |
needWaitTransaction(IgniteInternalTx tx,
AffinityTopologyVersion topVer) |
IgniteTxLocalAdapter |
newTx(boolean implicit,
boolean implicitSingle,
GridCacheContext sysCacheCtx,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
boolean storeEnabled,
int txSize) |
<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 |
onKernalStart0(boolean reconnect) |
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)
Handles prepare stage of 2PC.
|
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 |
rollbackTx(IgniteInternalTx tx)
Rolls back a transaction.
|
boolean |
salvageTx(IgniteInternalTx tx)
Invalidates transaction.
|
void |
sendDeferredAckResponse(UUID nodeId,
GridCacheVersion ver) |
boolean |
setTxTopologyHint(AffinityTopologyVersion topVer) |
int |
slowTxWarnTimeout() |
void |
slowTxWarnTimeout(int slowTxWarnTimeout) |
protected void |
start0() |
<T> T |
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() |
Collection<IgniteInternalTx> |
txs() |
IgniteInternalFuture<Boolean> |
txsPreparedOrCommitted(GridCacheVersion nearVer,
int txNum)
Checks if transactions with given near version ID was prepared or committed.
|
IgniteInternalTx |
txx() |
void |
uncommitTx(IgniteInternalTx tx)
Tries to minimize damage from partially-committed transaction.
|
IgniteInternalTx |
userTx() |
IgniteInternalTx |
userTx(GridCacheContext cctx) |
<T extends IgniteTxLocalEx> |
userTxx() |
IgnitePair<Collection<GridCacheVersion>> |
versions(GridCacheVersion min) |
context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStop, start, startInfo, stop, stop0, stopInfo, toStringpublic static final int DEFERRED_ONE_PHASE_COMMIT_ACK_REQUEST_TIMEOUT
public static final IgniteProductVersion TX_DEADLOCK_DETECTION_SINCE
protected void onKernalStart0(boolean reconnect)
onKernalStart0 in class GridCacheSharedManagerAdapterreconnect - True if manager restarted after client reconnect.protected void onKernalStop0(boolean cancel)
onKernalStop0 in class GridCacheSharedManagerAdaptercancel - Cancel flag.protected void start0()
throws IgniteCheckedException
start0 in class GridCacheSharedManagerAdapterIgniteCheckedException - If failed.public void onDisconnected(IgniteFuture reconnectFut)
onDisconnected in interface GridCacheSharedManageronDisconnected in class GridCacheSharedManagerAdapterreconnectFut - Reconnect future.public IgniteTxHandler txHandler()
public boolean salvageTx(IgniteInternalTx tx)
tx - Transaction.True if transaction was salvaged by this call.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 boolean isCompleted(IgniteInternalTx tx)
tx - Transaction to check.True if transaction has been committed or rolled back,
false otherwise.public IgniteTxLocalAdapter newTx(boolean implicit, boolean implicitSingle, @Nullable GridCacheContext sysCacheCtx, TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, boolean storeEnabled, int txSize)
implicit - True if transaction is implicit.implicitSingle - Implicit-with-single-key flag.concurrency - Concurrency.isolation - Isolation.timeout - transaction timeout.txSize - Expected transaction size.@Nullable public <T extends IgniteInternalTx> T onCreated(@Nullable GridCacheContext cacheCtx, T tx)
cacheCtx - Cache context.tx - Created transaction.public IgniteInternalFuture<Boolean> finishTxs(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 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 <T> T localTx()
public <T> T threadLocalTx(GridCacheContext cctx)
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 IgniteInternalTx localTxx()
public IgniteInternalTx txx()
@Nullable public IgniteInternalTx userTx()
@Nullable public IgniteInternalTx userTx(GridCacheContext cctx)
@Nullable public <T extends IgniteTxLocalEx> T userTxx()
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) throws IgniteCheckedException
tx - Transaction to prepare.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)
tx - Transaction to commit.public void rollbackTx(IgniteInternalTx tx)
tx - Transaction to rollback.public void fastFinishTx(GridNearTxLocal tx, boolean commit)
tx - Transaction to finish.commit - True if transaction is committed, false if rolled back.public void uncommitTx(IgniteInternalTx tx)
tx - Tx to uncommit.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 Collection<IgniteInternalTx> txs()
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()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.8.0 Release Date : December 5 2016