public class IgniteTxManager extends GridCacheSharedManagerAdapter
cctx, log| Constructor and Description |
|---|
IgniteTxManager() |
| Modifier and Type | Method and Description |
|---|---|
Collection<IgniteInternalTx> |
activeTransactions() |
void |
addAlternateVersion(GridCacheVersion ver,
IgniteInternalTx tx) |
boolean |
addCommittedTx(GridCacheVersion xidVer,
GridCacheVersion nearXidVer) |
boolean |
addCommittedTx(IgniteInternalTx tx) |
boolean |
addRolledbackTx(GridCacheVersion xidVer) |
boolean |
addRolledbackTx(IgniteInternalTx tx) |
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)
Commits transaction in case when node started transaction failed, but all related
transactions were prepared (invalidates transaction if it is not fully prepared).
|
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 |
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.
|
int |
idMapSize() |
boolean |
inUserTx() |
boolean |
isCompleted(IgniteInternalTx tx) |
<T> T |
localTx() |
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 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).
|
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 |
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() |
<T> T |
threadLocalTx(GridCacheContext cctx) |
int |
threadMapSize() |
<T> T |
tx() |
<T extends IgniteInternalTx> |
tx(GridCacheVersion txId) |
IgniteInternalFuture<Boolean> |
txCommitted(GridCacheVersion ver) |
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() |
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 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)
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 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.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 Collection<IgniteInternalTx> activeTransactions()
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 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 ver)
ver - Version.public void finishTxOnRecovery(IgniteInternalTx tx, boolean commit)
tx - Transaction.commit - Whether transaction should be committed or rolled back.public void commitIfPrepared(IgniteInternalTx tx)
tx - Transaction.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.1.0-incubating Release Date : May 20 2015