/** * Concatenates strings using provided delimiter. * * @param c Input collection. * @param delim Delimiter (optional). * @return Concatenated string. */ public static String concat(Iterable<?> c, @Nullable String delim) { A.notNull(c, "c"); IgniteReducer<? super String, String> f = new StringConcatReducer(delim); for (Object x : c) if (!f.collect(x == null ? null : x.toString())) break; return f.reduce(); }
/** {@inheritDoc} */ @Override public R2 reduce(List<ComputeJobResult> res) { return rdc.reduce(); } }
/** {@inheritDoc} */ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) { ComputeJobResultPolicy resPlc = super.result(res, rcvd); if (res.getException() == null && resPlc != FAILOVER && !rdc.collect((R1)res.getData())) resPlc = REDUCE; // If reducer returned false - reduce right away. return resPlc; }
/** {@inheritDoc} */ @Override public R2 reduce(List<ComputeJobResult> res) { return t.get3().reduce(); } }
/** {@inheritDoc} */ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) { ComputeJobResultPolicy resPlc = super.result(res, rcvd); if (res.getException() == null && resPlc != FAILOVER && !t.get3().collect((R1)res.getData())) resPlc = REDUCE; // If reducer returned false - reduce right away. return resPlc; }
@Override public void run() { c1.apply(msg); c2.apply(msg); c3.apply(); c4.reduce(); System.out.println("Test message: " + msg); } });
/** {@inheritDoc} */ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) { ComputeJobResultPolicy resPlc = super.result(res, rcvd); if (res.getException() == null && resPlc != FAILOVER && !rdc.collect((R1)res.getData())) resPlc = REDUCE; // If reducer returned false - reduce right away. return resPlc; }
/** * Check completeness of the future. */ private void checkComplete() { if (initialized() && !isDone() && lsnrCalls == futuresCount()) { try { onDone(rdc != null ? rdc.reduce() : null); } catch (RuntimeException e) { logError(logger(), "Failed to execute compound future reducer: " + this, e); onDone(e); } catch (AssertionError e) { logError(logger(), "Failed to execute compound future reducer: " + this, e); onDone(e); throw e; } } }
/** {@inheritDoc} */ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) { ComputeJobResultPolicy resPlc = super.result(res, rcvd); if (res.getException() == null && resPlc != FAILOVER && !t.get3().collect((R1)res.getData())) resPlc = REDUCE; // If reducer returned false - reduce right away. return resPlc; }
/** {@inheritDoc} */ @Override public R2 reduce(List<ComputeJobResult> res) { return rdc.reduce(); } }
/** {@inheritDoc} */ @Override public R2 reduce(List<ComputeJobResult> res) { return t.get3().reduce(); } }
/** * Concatenates strings using provided delimiter. * * @param c Input collection. * @param delim Delimiter (optional). * @return Concatenated string. */ public static String concat(Iterable<?> c, @Nullable String delim) { A.notNull(c, "c"); IgniteReducer<? super String, String> f = new StringConcatReducer(delim); for (Object x : c) if (!f.collect(x == null ? null : x.toString())) break; return f.reduce(); }
/** * Check completeness of the future. */ private void checkComplete() { if (initialized() && !isDone() && lsnrCalls == futuresCount()) { try { onDone(rdc != null ? rdc.reduce() : null); } catch (RuntimeException e) { logError(logger(), "Failed to execute compound future reducer: " + this, e); onDone(e); } catch (AssertionError e) { logError(logger(), "Failed to execute compound future reducer: " + this, e); onDone(e); throw e; } } }