Class GroupAggregateBuilder1<T0,K>

java.lang.Object
com.hazelcast.jet.pipeline.GroupAggregateBuilder1<T0,K>
Type Parameters:
T0 - type of the stream-0 item
K - type of the grouping key

public class GroupAggregateBuilder1<T0,K> extends Object
Offers a step-by-step API to build a pipeline stage that co-groups and aggregates the data from several input stages. To obtain it, call BatchStageWithKey.aggregateBuilder() on one of the stages to co-group and refer to that method's Javadoc for further details.

Note: this is not a builder of AggregateOperation. If that's what you are looking for, go here.

Since:
Jet 3.0
  • Method Details

    • tag0

      @Nonnull public Tag<T0> tag0()
      Returns the tag corresponding to the pipeline stage this builder was obtained from. Use this tag to refer to this stage when building the AggregateOperation that you'll pass to build(aggrOp).
    • add

      @Nonnull public <T> Tag<T> add(@Nonnull BatchStageWithKey<T,K> stage)
      Adds another stage that will contribute its data to the aggregate operation to be performed. Returns the tag you'll use to refer to this stage when building the AggregateOperation that you'll pass to build().
    • build

      @Deprecated @Nonnull public <R, OUT> BatchStage<OUT> build(@Nonnull AggregateOperation<?,R> aggrOp, @Nonnull BiFunctionEx<? super K,? super R,OUT> mapToOutputFn)
      Deprecated.
      This is a leftover from an earlier development cycle of the Pipeline API. Use build(AggregateOperation) instead and add a separate mapping stage with mapToOutputFn.
      Creates and returns a pipeline stage that performs the co-grouping and aggregation of pipeline stages registered with this builder object. The tags you register with the aggregate operation must match the tags you registered with this builder. It applies the mapToOutputFn to the key and the corresponding result of the aggregate operation to obtain the final output of the stage.
      Type Parameters:
      R - result type of the aggregate operation
      OUT - output type of the returned stage
      Parameters:
      aggrOp - the aggregate operation to perform
      mapToOutputFn - the function to map the output. It must be stateless and cooperative.
      Returns:
      a new stage representing the co-group-and-aggregate operation
    • build

      @Nonnull public <R> BatchStage<Map.Entry<K,R>> build(@Nonnull AggregateOperation<?,R> aggrOp)
      Creates and returns a pipeline stage that performs the co-grouping and aggregation of pipeline stages registered with this builder object. The tags you register with the aggregate operation must match the tags you registered with this builder.
      Type Parameters:
      R - output type of the returned stage
      Parameters:
      aggrOp - the aggregate operation to perform
      Returns:
      a new stage representing the co-group-and-aggregate operation