org.apache.ignite.internal.processors.cache.transactions

## 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 and Description
`IgniteTxHandler(GridCacheSharedContext ctx)`

### Method Summary

Methods
`boolean` `checkDhtRemoteTxCommitted(GridCacheVersion writeVer)` Checks whether DHT remote transaction with given version has been committed.
`protected void` `finish(UUID nodeId, GridDistributedTxRemoteAdapter tx, GridDhtTxPrepareRequest req)`
`IgniteInternalFuture<IgniteInternalTx>` `finish(UUID nodeId, GridNearTxLocal locTx, GridNearTxFinishRequest req)`
`protected void` `finish(UUID nodeId, IgniteTxRemoteEx tx, GridDhtTxFinishRequest req)`
`IgniteInternalFuture<IgniteInternalTx>` `finishColocatedLocal(boolean commit, GridNearTxLocal tx)`
`IgniteInternalFuture<GridNearTxPrepareResponse>` `prepareTx(UUID nearNodeId, GridNearTxLocal locTx, GridNearTxPrepareRequest req)`
`protected void` `processCheckPreparedTxRequest(UUID nodeId, GridCacheTxRecoveryRequest req)`
`protected void` `processCheckPreparedTxResponse(UUID nodeId, GridCacheTxRecoveryResponse res)`
`protected void` `processDhtTxFinishRequest(UUID nodeId, GridDhtTxFinishRequest req)`
`protected void` `processDhtTxPrepareRequest(UUID nodeId, GridDhtTxPrepareRequest req)`
`IgniteInternalFuture<IgniteInternalTx>` `processNearTxFinishRequest(UUID nodeId, GridNearTxFinishRequest req)`
`IgniteInternalFuture<?>` `processNearTxPrepareRequest(UUID nearNodeId, GridNearTxPrepareRequest req)`
`protected void` `sendReply(UUID nodeId, GridDhtTxFinishRequest req, boolean committed)` Sends tx finish response to remote node, if response is requested.
`GridNearTxRemote` `startNearRemoteTx(ClassLoader ldr, UUID nodeId, GridDhtTxPrepareRequest req)` Called while processing dht tx prepare request.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### IgniteTxHandler

    public IgniteTxHandler(GridCacheSharedContext ctx)

Parameters:
  `ctx` - Shared cache context.

### Method Detail

#### processNearTxPrepareRequest

    public IgniteInternalFuture<?> processNearTxPrepareRequest(UUID nearNodeId,
                                                      GridNearTxPrepareRequest req)

Parameters:
  `nearNodeId` - Node ID.
  `req` - Request.
Returns:
  Prepare future.

#### prepareTx

    public IgniteInternalFuture<GridNearTxPrepareResponse> prepareTx(UUID nearNodeId,
                                                            @Nullable
                                                            GridNearTxLocal locTx,
                                                            GridNearTxPrepareRequest req)

Parameters:
  `nearNodeId` - Near node ID that initiated transaction.
  `locTx` - Optional local transaction.
  `req` - Near prepare request.
Returns:
  Future for transaction.

#### processNearTxFinishRequest

    @Nullable
    public IgniteInternalFuture<IgniteInternalTx> processNearTxFinishRequest(UUID nodeId,
                                                                             GridNearTxFinishRequest req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.
Returns:
  Future.

#### finish

    @Nullable
    public IgniteInternalFuture<IgniteInternalTx> finish(UUID nodeId,
                                                         @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 if `false`).
  `tx` - Transaction to commit.
Returns:
  Future.

#### processDhtTxPrepareRequest

    protected final void processDhtTxPrepareRequest(UUID nodeId,
                                  GridDhtTxPrepareRequest req)

Parameters:
  `nodeId` - Sender node ID.
  `req` - Request.

#### processDhtTxFinishRequest

    protected final void processDhtTxFinishRequest(UUID nodeId,
                                 GridDhtTxFinishRequest req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.

#### checkDhtRemoteTxCommitted

    public boolean checkDhtRemoteTxCommitted(GridCacheVersion writeVer)

Checks whether DHT remote transaction with given version has been committed. If not, will add version to rollback version set so that late response will not falsely commit this transaction.

Parameters:
  `writeVer` - Write version to check.
Returns:
  `True` if transaction has been committed, `false` otherwise.

#### finish

    protected void finish(UUID nodeId,
              IgniteTxRemoteEx tx,
              GridDhtTxFinishRequest req)

Parameters:
  `nodeId` - Node ID.
  `tx` - Transaction.
  `req` - Request.

#### finish

    protected void finish(UUID nodeId,
              GridDistributedTxRemoteAdapter tx,
              GridDhtTxPrepareRequest req)
                   throws IgniteTxHeuristicCheckedException

Parameters:
  `nodeId` - Node ID.
  `tx` - Transaction.
  `req` - Request.
Throws:
  `IgniteTxHeuristicCheckedException`

#### sendReply

    protected void sendReply(UUID nodeId,
                 GridDhtTxFinishRequest req,
                 boolean committed)

Sends tx finish response to remote node, if response is requested.

Parameters:
  `nodeId` - Node id that originated finish request.
  `req` - Request.
  `committed` - `True` if transaction committed on this node.

#### startNearRemoteTx

    @Nullable
    public GridNearTxRemote startNearRemoteTx(ClassLoader ldr,
                                              UUID nodeId,
                                              GridDhtTxPrepareRequest req)
                                       throws IgniteCheckedException

Called while processing dht tx prepare request.

Parameters:
  `ldr` - Loader.
  `nodeId` - Sender node ID.
  `req` - Request.
Returns:
  Remote transaction.
Throws:
  `IgniteCheckedException` - If failed.

#### processCheckPreparedTxRequest

    protected void processCheckPreparedTxRequest(UUID nodeId,
                                     GridCacheTxRecoveryRequest req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.

#### processCheckPreparedTxResponse

    protected void processCheckPreparedTxResponse(UUID nodeId,
                                      GridCacheTxRecoveryResponse res)

Parameters:
  `nodeId` - Node ID.
  `res` - Response.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015