/** {@inheritDoc} */ @Override public Object reduce(List<ComputeJobResult> results) { if (log.isInfoEnabled()) log.info("Aggregating job [job=" + this + ", results=" + results + ']'); int res = 0; for (ComputeJobResult result : results) { assert result != null; if (result.getData() != null) res += (Integer) result.getData(); } return res; }
/** {@inheritDoc} */ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) { if (res.getException() != null) return FAILOVER; return WAIT; }