/** {@inheritDoc} */ @Nullable @Override protected Map<UUID, GridBiTuple<Long, Long>> reduce0(List<GridComputeJobResult> results) throws GridException { Map<UUID, GridBiTuple<Long, Long>> total = new HashMap<>(); for (GridComputeJobResult res: results) { GridBiTuple<Long, Long> jobRes = res.getData(); total.put(res.getNode().id(), jobRes); } return total; }
/** {@inheritDoc} */ @Nullable @Override protected Iterable<GridBiTuple<UUID, VisorLicense>> reduce0(List<GridComputeJobResult> results) throws GridException { Collection<GridBiTuple<UUID, VisorLicense>> licenses = new ArrayList<>(results.size()); for (GridComputeJobResult r : results) { VisorLicense license = r.getException() != null ? null : (VisorLicense) r.getData(); licenses.add(new GridBiTuple<>(r.getNode().id(), license)); } return licenses; }
UUID nid = res.getNode().id();
/** {@inheritDoc} */ @Nullable @Override protected GridBiTuple<Iterable<GridBiTuple<Exception, UUID>>, Iterable<VisorLogSearchResult>> reduce0(List<GridComputeJobResult> results) throws GridException { Collection<VisorLogSearchResult> searchRes = new ArrayList<>(); Collection<GridBiTuple<Exception, UUID>> exRes = new ArrayList<>(); // Separate successfully executed results and exceptions. for (GridComputeJobResult result : results) { if (result.getException() != null) exRes.add(new GridBiTuple<Exception, UUID>(result.getException(), result.getNode().id())); else if(result.getData() != null) { Collection<VisorLogSearchResult> data = result.getData(); searchRes.addAll(data); } } return new GridBiTuple<Iterable<GridBiTuple<Exception, UUID>>, Iterable<VisorLogSearchResult>> (exRes.isEmpty() ? null : exRes, searchRes.isEmpty() ? null : searchRes); } /**
if (thief.equals(ctx.getJobResult().getNode())) { U.error(log, "Job stealer node is equal to job node (will fail-over using " + "load-balancing): " + thief.id()); log.debug("Failing-over stolen job [from=" + ctx.getJobResult().getNode() + ", to=" + thief + ']'); failedNodes.add(ctx.getJobResult().getNode().id()); ", oldNode=" + ctx.getJobResult().getNode().id() + ", sesId=" + ctx.getTaskSession().getId() + ", job=" + ctx.getJobResult().getJob() + if (log.isInfoEnabled()) log.info("Stealing job to a new node [newNode=" + thief.id() + ", oldNode=" + ctx.getJobResult().getNode().id() + ", sesId=" + ctx.getTaskSession().getId() + ", job=" + ctx.getJobResult().getJob() +
jobRes.getNode(), "Job got resulted with: " + plc);