Search in sources :

Example 1 with VisorExceptionWrapper

use of org.apache.ignite.internal.visor.util.VisorExceptionWrapper in project ignite by apache.

the class VisorNodeDataCollectorTask method reduce.

/**
     * @param taskRes Task result.
     * @param results Results.
     * @return Data collector task result.
     */
protected VisorNodeDataCollectorTaskResult reduce(VisorNodeDataCollectorTaskResult taskRes, List<ComputeJobResult> results) {
    for (ComputeJobResult res : results) {
        VisorNodeDataCollectorJobResult jobRes = res.getData();
        if (jobRes != null) {
            UUID nid = res.getNode().id();
            IgniteException unhandledEx = res.getException();
            if (unhandledEx == null)
                reduceJobResult(taskRes, jobRes, nid);
            else {
                // Ignore nodes that left topology.
                if (!(unhandledEx instanceof ClusterGroupEmptyException))
                    taskRes.getUnhandledEx().put(nid, new VisorExceptionWrapper(unhandledEx));
            }
        }
    }
    taskRes.setActive(ignite.active());
    return taskRes;
}
Also used : IgniteException(org.apache.ignite.IgniteException) ClusterGroupEmptyException(org.apache.ignite.cluster.ClusterGroupEmptyException) VisorExceptionWrapper(org.apache.ignite.internal.visor.util.VisorExceptionWrapper) UUID(java.util.UUID) ComputeJobResult(org.apache.ignite.compute.ComputeJobResult)

Aggregations

UUID (java.util.UUID)1 IgniteException (org.apache.ignite.IgniteException)1 ClusterGroupEmptyException (org.apache.ignite.cluster.ClusterGroupEmptyException)1 ComputeJobResult (org.apache.ignite.compute.ComputeJobResult)1 VisorExceptionWrapper (org.apache.ignite.internal.visor.util.VisorExceptionWrapper)1