Search in sources :

Example 1 with GridNearTxFinishFuture

use of org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishFuture in project ignite by apache.

the class IgniteTxHandler method processDhtTxFinishResponse.

/**
 * @param nodeId Node ID.
 * @param res Response.
 */
private void processDhtTxFinishResponse(UUID nodeId, GridDhtTxFinishResponse res) {
    try (TraceSurroundings ignored = MTC.support(ctx.kernalContext().tracing().create(TX_PROCESS_DHT_FINISH_RESP, MTC.span()))) {
        assert nodeId != null;
        assert res != null;
        if (res.checkCommitted()) {
            GridNearTxFinishFuture fut = (GridNearTxFinishFuture) ctx.mvcc().<IgniteInternalTx>future(res.futureId());
            if (fut == null) {
                if (txFinishMsgLog.isDebugEnabled()) {
                    txFinishMsgLog.debug("Failed to find future for dht finish check committed response [txId=null" + ", dhtTxId=" + res.xid() + ", node=" + nodeId + ", res=" + res + ']');
                }
                return;
            } else if (txFinishMsgLog.isDebugEnabled()) {
                txFinishMsgLog.debug("Received dht finish check committed response [txId=" + fut.tx().nearXidVersion() + ", dhtTxId=" + res.xid() + ", node=" + nodeId + ']');
            }
            fut.onResult(nodeId, res);
        } else {
            GridDhtTxFinishFuture fut = (GridDhtTxFinishFuture) ctx.mvcc().<IgniteInternalTx>future(res.futureId());
            if (fut == null) {
                if (txFinishMsgLog.isDebugEnabled()) {
                    txFinishMsgLog.debug("Failed to find future for dht finish response [txId=null" + ", dhtTxId=" + res.xid() + ", node=" + nodeId + ", res=" + res);
                }
                return;
            } else if (txFinishMsgLog.isDebugEnabled()) {
                txFinishMsgLog.debug("Received dht finish response [txId=" + fut.tx().nearXidVersion() + ", dhtTxId=" + res.xid() + ", node=" + nodeId + ']');
            }
            fut.onResult(nodeId, res);
        }
    }
}
Also used : GridDhtTxFinishFuture(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishFuture) GridNearTxFinishFuture(org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishFuture) TraceSurroundings(org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings)

Example 2 with GridNearTxFinishFuture

use of org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishFuture in project ignite by apache.

the class IgniteTxHandler method processNearTxFinishResponse.

/**
 * @param nodeId Node ID.
 * @param res Response.
 */
private void processNearTxFinishResponse(UUID nodeId, GridNearTxFinishResponse res) {
    try (TraceSurroundings ignored = MTC.support(ctx.kernalContext().tracing().create(TX_NEAR_FINISH_RESP, MTC.span()))) {
        if (txFinishMsgLog.isDebugEnabled())
            txFinishMsgLog.debug("Received near finish response [txId=" + res.xid() + ", node=" + nodeId + ']');
        GridNearTxFinishFuture fut = (GridNearTxFinishFuture) ctx.mvcc().<IgniteInternalTx>future(res.futureId());
        if (fut == null) {
            if (txFinishMsgLog.isDebugEnabled()) {
                txFinishMsgLog.debug("Failed to find future for near finish response [txId=" + res.xid() + ", node=" + nodeId + ", res=" + res + ']');
            }
            return;
        }
        fut.onResult(nodeId, res);
    }
}
Also used : GridNearTxFinishFuture(org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishFuture) TraceSurroundings(org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings)

Aggregations

GridNearTxFinishFuture (org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishFuture)2 TraceSurroundings (org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings)2 GridDhtTxFinishFuture (org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishFuture)1