public class IgniteTxManager extends GridCacheSharedManagerAdapter
cctx, log| Constructor and Description |
|---|
IgniteTxManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlternateVersion(GridCacheVersion ver,
IgniteInternalTx tx) |
boolean |
addCommittedTx(GridCacheVersion xidVer,
GridCacheVersion nearXidVer) |
boolean |
addCommittedTx(IgniteInternalTx tx) |
boolean |
addRolledbackTx(GridCacheVersion xidVer) |
boolean |
addRolledbackTx(IgniteInternalTx tx) |
void |
addSynchronizations(TransactionSynchronization... sync) |
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.
|
int |
commitQueueSize() |
Collection<GridCacheVersion> |
committedVersions(GridCacheVersion min)
Gets committed transactions starting from the given version (inclusive). // TODO: GG-4011: why inclusive?
|
void |
commitTx(IgniteInternalTx tx)
Commits a transaction.
|
int |
completedVersionsSize() |
void |
finishOptimisticTxOnRecovery(IgniteInternalTx tx,
boolean commit)
Commits or rolls back prepared transaction.
|
void |
finishPessimisticTxOnRecovery(IgniteInternalTx tx,
GridCacheCommittedTxInfo commitInfo)
Commits or rolls back pessimistic transaction.
|
void |
finishSyncDisabled(boolean finishSyncDisabled)
For test purposes only.
|
IgniteInternalFuture<Boolean> |
finishTxs(long topVer)
Creates a future that will wait for all ongoing transactions that maybe affected by topology update
to be finished.
|
int |
idMapSize() |
boolean |
inUserTx() |
boolean |
isCompleted(IgniteInternalTx tx) |
<T> T |
localTx() |
IgniteInternalTx |
localTxForRecovery(GridCacheVersion nearXidVer,
boolean markFinalizing)
Gets local transaction for pessimistic tx recovery.
|
IgniteInternalTx |
localTxx() |
GridCacheVersion |
mappedVersion(GridCacheVersion from) |
<T extends IgniteInternalTx> |
nearTx(GridCacheVersion txId) |
GridCacheVersion |
nearVersion(GridCacheVersion dhtVer)
Reverse mapped version look up.
|
IgniteTxLocalAdapter |
newTx(boolean implicit,
boolean implicitSingle,
GridCacheContext sysCacheCtx,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
boolean invalidate,
boolean storeEnabled,
int txSize,
IgniteTxKey grpLockKey,
boolean partLock) |
<T extends IgniteInternalTx> |
onCreated(GridCacheContext cacheCtx,
T tx) |
void |
onFinishedRemote(UUID rmtNodeId,
long threadId)
Callback invoked when near finish response is received from remote node.
|
protected void |
onKernalStart0() |
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 |
onTxStateChange(TransactionState prevState,
TransactionState newState,
IgniteInternalTx tx) |
int |
prepareQueueSize() |
void |
prepareTx(IgniteInternalTx tx)
Handles prepare stage of 2PC.
|
void |
printMemoryStats()
Prints out memory stats to standard out.
|
void |
removeCommittedTx(IgniteInternalTx tx) |
void |
removeSynchronizations(TransactionSynchronization... sync) |
void |
resetContext()
Commit ended.
|
void |
rollbackTx(IgniteInternalTx tx)
Rolls back a transaction.
|
Collection<GridCacheVersion> |
rolledbackVersions(GridCacheVersion min)
Gets rolledback transactions starting from the given version (inclusive). // TODO: GG-4011: why inclusive?
|
boolean |
salvageTx(IgniteInternalTx tx)
Invalidates transaction.
|
int |
slowTxWarnTimeout() |
void |
slowTxWarnTimeout(int slowTxWarnTimeout) |
protected void |
start0() |
int |
startVersionCountsSize() |
Collection<TransactionSynchronization> |
synchronizations() |
<T> T |
threadLocalTx(GridCacheContext cctx) |
int |
threadMapSize() |
<T> T |
tx() |
<T extends IgniteInternalTx> |
tx(GridCacheVersion txId) |
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() |
boolean |
txsPreparedOrCommitted(GridCacheVersion nearVer,
int txNum)
Checks if transactions with given near version ID was prepared or committed.
|
IgniteInternalTx |
txx() |
IgniteInternalTx |
txx(GridCacheVersion txId) |
void |
uncommitTx(IgniteInternalTx tx)
Tries to minimize damage from partially-committed transaction.
|
IgniteInternalTx |
userTx() |
IgniteInternalTx |
userTx(GridCacheContext cctx) |
<T extends IgniteTxLocalEx> |
userTxx() |
context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStop, onKernalStop0, start, startInfo, stop, stop0, stopInfo, toStringprotected void onKernalStart0()
onKernalStart0 in class GridCacheSharedManagerAdapterprotected void start0()
throws IgniteCheckedException
start0 in class GridCacheSharedManagerAdapterIgniteCheckedException - If failed.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 commitQueueSize()
public int prepareQueueSize()
public int startVersionCountsSize()
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 invalidate, boolean storeEnabled, int txSize, @Nullable IgniteTxKey grpLockKey, boolean partLock)
implicit - True if transaction is implicit.implicitSingle - Implicit-with-single-key flag.concurrency - Concurrency.isolation - Isolation.timeout - transaction timeout.txSize - Expected transaction size.grpLockKey - Group lock key if this is a group-lock transaction.partLock - True if partition is locked.@Nullable public <T extends IgniteInternalTx> T onCreated(@Nullable GridCacheContext cacheCtx, T tx)
tx - Created transaction.public IgniteInternalFuture<Boolean> finishTxs(long 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 onStarted(IgniteInternalTx tx)
tx - Started transaction.True if transaction is not in completed set.@Nullable public GridCacheVersion nearVersion(GridCacheVersion dhtVer)
dhtVer - Dht version.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 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.@Nullable public IgniteInternalTx txx(GridCacheVersion txId)
txId - Transaction ID.public void prepareTx(IgniteInternalTx tx) throws IgniteCheckedException
tx - Transaction to prepare.IgniteCheckedException - If preparation failed.public Collection<GridCacheVersion> committedVersions(GridCacheVersion min)
min - Start (or minimum) version.public Collection<GridCacheVersion> rolledbackVersions(GridCacheVersion min)
min - Start (or minimum) version.public void removeCommittedTx(IgniteInternalTx tx)
tx - Tx to remove.public boolean addCommittedTx(IgniteInternalTx tx)
tx - Committed transaction.public boolean addRolledbackTx(IgniteInternalTx tx)
tx - Committed transaction.public boolean addCommittedTx(GridCacheVersion xidVer, @Nullable GridCacheVersion nearXidVer)
xidVer - Completed transaction version.nearXidVer - Optional near transaction ID.public boolean addRolledbackTx(GridCacheVersion 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 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 addSynchronizations(TransactionSynchronization... sync)
sync - Transaction synchronizations to add.public void removeSynchronizations(TransactionSynchronization... sync)
sync - Transaction synchronizations to remove.public Collection<TransactionSynchronization> synchronizations()
public void onTxStateChange(@Nullable TransactionState prevState, TransactionState newState, IgniteInternalTx tx)
prevState - Previous state.newState - New state.tx - Cache transaction.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.public boolean txsPreparedOrCommitted(GridCacheVersion nearVer, int txNum)
nearVer - Near version ID.txNum - Number of transactions.True if transactions were prepared or committed.@Nullable public IgniteInternalTx localTxForRecovery(GridCacheVersion nearXidVer, boolean markFinalizing)
nearXidVer - Near tx ID.public void finishOptimisticTxOnRecovery(IgniteInternalTx tx, boolean commit)
tx - Transaction.commit - Whether transaction should be committed or rolled back.public void finishPessimisticTxOnRecovery(IgniteInternalTx tx, GridCacheCommittedTxInfo commitInfo)
tx - Transaction to finish.commitInfo - Commit information.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015