Class IgniteTxHandler
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler
-
public class IgniteTxHandler extends Object
Isolated logic to process cache messages.
-
-
Constructor Summary
Constructors Constructor Description IgniteTxHandler(GridCacheSharedContext ctx)
-
Method Summary
-
-
-
Constructor Detail
-
IgniteTxHandler
public IgniteTxHandler(GridCacheSharedContext ctx)
- Parameters:
ctx- Shared cache context.
-
-
Method Detail
-
prepareColocatedTx
public IgniteInternalFuture<GridNearTxPrepareResponse> prepareColocatedTx(GridNearTxLocal locTx, GridNearTxPrepareRequest req)
Prepares local colocated tx.- Parameters:
locTx- Local transaction.req- Near prepare request.- Returns:
- Prepare future.
-
prepareNearTxLocal
public IgniteInternalFuture<GridNearTxPrepareResponse> prepareNearTxLocal(GridNearTxLocal originTx, GridNearTxPrepareRequest req)
- Parameters:
originTx- Transaction for copy.req- Request.- Returns:
- Prepare future.
-
finish
@Nullable public @Nullable IgniteInternalFuture<IgniteInternalTx> finish(UUID nodeId, @Nullable @Nullable GridNearTxLocal locTx, GridNearTxFinishRequest req)
- Parameters:
nodeId- Node ID.locTx- Local transaction.req- Request.- Returns:
- Future.
-
finishColocatedLocal
public IgniteInternalFuture<IgniteInternalTx> finishColocatedLocal(boolean commit, GridNearTxLocal tx)
- Parameters:
commit- Commit flag (rollback iffalse).tx- Transaction to commit.- Returns:
- Future.
-
finish
protected void finish(IgniteTxRemoteEx tx, GridDhtTxFinishRequest req)
- Parameters:
tx- Transaction.req- Request.
-
finish
protected void finish(GridDistributedTxRemoteAdapter tx, GridDhtTxPrepareRequest req) throws IgniteTxHeuristicCheckedException
Finish for one-phase distributed tx.- Parameters:
tx- Transaction.req- Request.- Throws:
IgniteTxHeuristicCheckedException
-
processCheckPreparedTxResponse
protected void processCheckPreparedTxResponse(UUID nodeId, GridCacheTxRecoveryResponse res)
- Parameters:
nodeId- Node ID.res- Response.
-
applyPartitionsUpdatesCounters
public void applyPartitionsUpdatesCounters(Iterable<PartitionUpdateCountersMessage> counters) throws IgniteCheckedException
Applies partition counter updates for transactions.Called after entries are written to WAL on commit or during rollback to close gaps in update counter sequence.
- Parameters:
counters- Counters.- Throws:
IgniteCheckedException
-
applyPartitionsUpdatesCounters
public void applyPartitionsUpdatesCounters(Iterable<PartitionUpdateCountersMessage> counters, boolean rollback, boolean rollbackOnPrimary) throws IgniteCheckedException
Applies partition counter updates for transactions.Called after entries are written to WAL on commit or during rollback to close gaps in update counter sequence.
On rollback counters should be applied on the primary only after backup nodes, otherwise if the primary fail before sending rollback requests to backups remote transactions can be committed by recovery protocol and partition consistency will not be restored when primary returns to the grid because RollbackRecord was written (actual for persistent mode only).
- Parameters:
counters- Counter values to be updated.rollback-Trueif applied during rollbacks.rollbackOnPrimary-Trueif rollback happens on primary node. Passed to CQ engine.- Throws:
IgniteCheckedException
-
filterUpdateCountersForBackupNode
@Nullable public @Nullable List<PartitionUpdateCountersMessage> filterUpdateCountersForBackupNode(IgniteInternalTx tx, ClusterNode node)
- Parameters:
tx- Transaction.node- Backup node.- Returns:
- Partition counters for the given backup node.
-
-