Search in sources :

Example 1 with MvccFuture

use of org.apache.ignite.internal.processors.cache.mvcc.MvccFuture in project ignite by apache.

the class GridDhtTxFinishFuture method addDiagnosticRequest.

/**
 * {@inheritDoc}
 */
@Override
public void addDiagnosticRequest(IgniteDiagnosticPrepareContext ctx) {
    if (!isDone()) {
        for (IgniteInternalFuture fut : futures()) {
            if (!fut.isDone()) {
                if (MiniFuture.class.isInstance(fut)) {
                    MiniFuture f = (MiniFuture) fut;
                    if (!f.node().isLocal()) {
                        GridCacheVersion dhtVer = tx.xidVersion();
                        GridCacheVersion nearVer = tx.nearXidVersion();
                        ctx.remoteTxInfo(f.node().id(), dhtVer, nearVer, "GridDhtTxFinishFuture " + "waiting for response [node=" + f.node().id() + ", topVer=" + tx.topologyVersion() + ", dhtVer=" + dhtVer + ", nearVer=" + nearVer + ", futId=" + futId + ", miniId=" + f.futId + ", tx=" + tx + ']');
                        return;
                    }
                } else if (fut instanceof MvccFuture) {
                    MvccFuture f = (MvccFuture) fut;
                    if (!cctx.localNodeId().equals(f.coordinatorNodeId())) {
                        ctx.basicInfo(f.coordinatorNodeId(), "GridDhtTxFinishFuture " + "waiting for mvcc coordinator reply [mvccCrdNode=" + f.coordinatorNodeId() + ", loc=" + f.coordinatorNodeId().equals(cctx.localNodeId()) + ']');
                        return;
                    }
                }
            }
        }
    }
}
Also used : GridCacheVersion(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) MvccFuture(org.apache.ignite.internal.processors.cache.mvcc.MvccFuture) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture)

Example 2 with MvccFuture

use of org.apache.ignite.internal.processors.cache.mvcc.MvccFuture in project ignite by apache.

the class GridNearTxFinishFuture method toString.

/**
 * {@inheritDoc}
 */
@Override
public String toString() {
    Collection<String> futs = F.viewReadOnly(futures(), new C1<IgniteInternalFuture<?>, String>() {

        @Override
        public String apply(IgniteInternalFuture<?> f) {
            if (f.getClass() == FinishMiniFuture.class) {
                FinishMiniFuture fut = (FinishMiniFuture) f;
                ClusterNode node = fut.primary();
                if (node != null) {
                    return "FinishFuture[node=" + node.id() + ", loc=" + node.isLocal() + ", done=" + fut.isDone() + ']';
                } else
                    return "FinishFuture[node=null, done=" + fut.isDone() + ']';
            } else if (f.getClass() == CheckBackupMiniFuture.class) {
                CheckBackupMiniFuture fut = (CheckBackupMiniFuture) f;
                ClusterNode node = fut.node();
                if (node != null) {
                    return "CheckBackupFuture[node=" + node.id() + ", loc=" + node.isLocal() + ", done=" + f.isDone() + "]";
                } else
                    return "CheckBackupFuture[node=null, done=" + f.isDone() + "]";
            } else if (f.getClass() == CheckRemoteTxMiniFuture.class) {
                CheckRemoteTxMiniFuture fut = (CheckRemoteTxMiniFuture) f;
                return "CheckRemoteTxMiniFuture[nodes=" + fut.nodes() + ", done=" + f.isDone() + "]";
            } else if (f instanceof MvccFuture) {
                MvccFuture fut = (MvccFuture) f;
                return "WaitPreviousTxsFut[mvccCrd=" + fut.coordinatorNodeId() + ", done=" + f.isDone() + "]";
            } else
                return "[loc=true, done=" + f.isDone() + "]";
        }
    });
    return S.toString(GridNearTxFinishFuture.class, this, "innerFuts", futs, "super", super.toString());
}
Also used : ClusterNode(org.apache.ignite.cluster.ClusterNode) MvccFuture(org.apache.ignite.internal.processors.cache.mvcc.MvccFuture) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture)

Aggregations

IgniteInternalFuture (org.apache.ignite.internal.IgniteInternalFuture)2 MvccFuture (org.apache.ignite.internal.processors.cache.mvcc.MvccFuture)2 ClusterNode (org.apache.ignite.cluster.ClusterNode)1 GridCacheVersion (org.apache.ignite.internal.processors.cache.version.GridCacheVersion)1