public class IgniteTxManager<K,V> extends GridCacheSharedManagerAdapter<K,V>
cctx, log| Constructor and Description |
|---|
IgniteTxManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlternateVersion(GridCacheVersion ver,
IgniteInternalTx<K,V> tx) |
boolean |
addCommittedTx(GridCacheVersion xidVer,
GridCacheVersion nearXidVer) |
boolean |
addCommittedTx(IgniteInternalTx<K,V> tx) |
boolean |
addRolledbackTx(GridCacheVersion xidVer) |
boolean |
addRolledbackTx(IgniteInternalTx<K,V> 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<K,V> tx)
Commits a transaction.
|
int |
completedVersionsSize() |
void |
finishOptimisticTxOnRecovery(IgniteInternalTx<K,V> tx,
boolean commit)
Commits or rolls back prepared transaction.
|
void |
finishPessimisticTxOnRecovery(IgniteInternalTx<K,V> tx,
GridCacheCommittedTxInfo<K,V> 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<K,V> tx) |
<T> T |
localTx() |
IgniteInternalTx<K,V> |
localTxForRecovery(GridCacheVersion nearXidVer,
boolean markFinalizing)
Gets local transaction for pessimistic tx recovery.
|
IgniteInternalTx<K,V> |
localTxx() |
GridCacheVersion |
mappedVersion(GridCacheVersion from) |
<T extends IgniteInternalTx<K,V>> |
nearTx(GridCacheVersion txId) |
GridCacheVersion |
nearVersion(GridCacheVersion dhtVer)
Reverse mapped version look up.
|
IgniteTxLocalAdapter<K,V> |
newTx(boolean implicit,
boolean implicitSingle,
boolean sys,
TransactionConcurrency concurrency,
TransactionIsolation isolation,
long timeout,
boolean invalidate,
boolean storeEnabled,
int txSize,
IgniteTxKey grpLockKey,
boolean partLock) |
<T extends IgniteInternalTx<K,V>> |
onCreated(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<K,V> entry,
GridCacheMvccCandidate<K> owner)
Callback invoked whenever a member of a transaction acquires
lock ownership.
|
boolean |
onStarted(IgniteInternalTx<K,V> 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<K,V> tx)
Handles prepare stage of 2PC.
|
void |
printMemoryStats()
Prints out memory stats to standard out.
|
void |
removeCommittedTx(IgniteInternalTx<K,V> tx) |
void |
removeSynchronizations(TransactionSynchronization... sync) |
void |
rollbackTx(IgniteInternalTx<K,V> 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<K,V> tx)
Invalidates transaction.
|
int |
slowTxWarnTimeout() |
void |
slowTxWarnTimeout(int slowTxWarnTimeout) |
protected void |
start0() |
int |
startVersionCountsSize() |
Collection<TransactionSynchronization> |
synchronizations() |
<T> T |
threadLocalTx() |
int |
threadMapSize() |
<T> T |
tx() |
<T extends IgniteInternalTx<K,V>> |
tx(GridCacheVersion txId) |
<T> T |
tx(long threadId) |
void |
txContext(IgniteInternalTx tx) |
void |
txContextReset()
Commit ended.
|
GridCacheVersion |
txContextVersion()
Gets version of transaction in tx context or
null
if tx context is empty. |
IgniteTxHandler<K,V> |
txHandler() |
Collection<IgniteInternalTx<K,V>> |
txs() |
boolean |
txsPreparedOrCommitted(GridCacheVersion nearVer,
int txNum)
Checks if transactions with given near version ID was prepared or committed.
|
IgniteInternalTx<K,V> |
txx() |
IgniteInternalTx<K,V> |
txx(GridCacheVersion txId) |
void |
uncommitTx(IgniteInternalTx<K,V> tx)
Tries to minimize damage from partially-committed transaction.
|
IgniteInternalTx |
userTx() |
<T extends IgniteTxLocalEx<K,V>> |
userTxx() |
context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStop, onKernalStop0, start, startInfo, stop, stop0, stopInfo, toStringprotected void onKernalStart0()
onKernalStart0 in class GridCacheSharedManagerAdapter<K,V>protected void start0()
throws IgniteCheckedException
start0 in class GridCacheSharedManagerAdapter<K,V>IgniteCheckedException - If failed.public IgniteTxHandler<K,V> txHandler()
public boolean salvageTx(IgniteInternalTx<K,V> tx)
tx - Transaction.True if transaction was salvaged by this call.public void printMemoryStats()
USE ONLY FOR MEMORY PROFILING DURING TESTS.
printMemoryStats in interface GridCacheSharedManager<K,V>printMemoryStats in class GridCacheSharedManagerAdapter<K,V>public int threadMapSize()
public int idMapSize()
public int commitQueueSize()
public int prepareQueueSize()
public int startVersionCountsSize()
public int completedVersionsSize()
public boolean isCompleted(IgniteInternalTx<K,V> tx)
tx - Transaction to check.True if transaction has been committed or rolled back,
false otherwise.public IgniteTxLocalAdapter<K,V> newTx(boolean implicit, boolean implicitSingle, boolean sys, 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<K,V>> T onCreated(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<K,V> 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<K,V> tx)
ver - Alternate version.tx - Transaction.@Nullable public <T> T localTx()
public <T> T threadLocalTx()
public <T> T tx()
@Nullable public IgniteInternalTx<K,V> localTxx()
public IgniteInternalTx<K,V> txx()
@Nullable public IgniteInternalTx userTx()
@Nullable public <T extends IgniteTxLocalEx<K,V>> T userTxx()
public <T> T tx(long threadId)
threadId - Id of thread for transaction.public boolean inUserTx()
True if current thread is currently within transaction.@Nullable public <T extends IgniteInternalTx<K,V>> T tx(GridCacheVersion txId)
txId - Transaction ID.@Nullable public <T extends IgniteInternalTx<K,V>> T nearTx(GridCacheVersion txId)
txId - Transaction ID.@Nullable public IgniteInternalTx<K,V> txx(GridCacheVersion txId)
txId - Transaction ID.public void prepareTx(IgniteInternalTx<K,V> 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<K,V> tx)
tx - Tx to remove.public boolean addCommittedTx(IgniteInternalTx<K,V> tx)
tx - Committed transaction.public boolean addRolledbackTx(IgniteInternalTx<K,V> 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<K,V> tx)
tx - Transaction to commit.public void rollbackTx(IgniteInternalTx<K,V> tx)
tx - Transaction to rollback.public void uncommitTx(IgniteInternalTx<K,V> tx)
tx - Tx to uncommit.public boolean onOwnerChanged(GridCacheEntryEx<K,V> entry, GridCacheMvccCandidate<K> 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 txContextReset()
public Collection<IgniteInternalTx<K,V>> 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<K,V> localTxForRecovery(GridCacheVersion nearXidVer, boolean markFinalizing)
nearXidVer - Near tx ID.public void finishOptimisticTxOnRecovery(IgniteInternalTx<K,V> tx, boolean commit)
tx - Transaction.commit - Whether transaction should be committed or rolled back.public void finishPessimisticTxOnRecovery(IgniteInternalTx<K,V> tx, GridCacheCommittedTxInfo<K,V> commitInfo)
tx - Transaction to finish.commitInfo - Commit information.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 17 2015