/** * Attaches a stage that co-aggregates the data from this and the two * supplied stages by performing a separate aggregate operation on each and * emitting a {@link Tuple3} with their results. * <p> * The returned stage emits a single item. * * @param aggrOp0 aggregate operation to perform on this stage * @param stage1 the first additional stage * @param aggrOp1 aggregate operation to perform on {@code stage1} * @param stage2 the second additional stage * @param aggrOp2 aggregate operation to perform on {@code stage2} * @param <T1> type of the items in {@code stage1} * @param <T2> type of the items in {@code stage2} * @param <R0> type of the aggregated result for this stage * @param <R1> type of the aggregated result for {@code stage1} * @param <R2> type of the aggregated result for {@code stage2} */ @Nonnull default <T1, T2, R0, R1, R2> BatchStage<Tuple3<R0, R1, R2>> aggregate3( @Nonnull AggregateOperation1<? super T, ?, ? extends R0> aggrOp0, @Nonnull BatchStage<T1> stage1, @Nonnull AggregateOperation1<? super T1, ?, ? extends R1> aggrOp1, @Nonnull BatchStage<T2> stage2, @Nonnull AggregateOperation1<? super T2, ?, ? extends R2> aggrOp2 ) { return aggregate3(stage1, stage2, aggregateOperation3(aggrOp0, aggrOp1, aggrOp2, Tuple3::tuple3)); }
@Nonnull DistributedTriFunction<? super R0, ? super R1, ? super R2, ? extends OUT> mapToOutputFn ) { return aggregate3(stage1, stage2, aggregateOperation3(aggrOp0, aggrOp1, aggrOp2, mapToOutputFn));