com.hazelcast.jet.pipeline

## Class WindowAggregateBuilder1<T0>

- java.lang.Object
- - com.hazelcast.jet.pipeline.WindowAggregateBuilder1<T0>

- Type Parameters:
    `T0` - the type of the stream-0 item

      public class WindowAggregateBuilder1<T0>
      extends Object

  Offers a step-by-step fluent API to build a pipeline stage that performs a windowed co-aggregation of the data from several input stages. To obtain it, call `StageWithWindow.aggregateBuilder()` on one of the stages to co-aggregate 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`.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<E> Tag<E>` | `add(StreamStage<E> stage)` Adds another stage that will contribute its data to the aggregate operation to be performed.
    `<R,OUT> StreamStage<OUT>` | `build(AggregateOperation<?,R> aggrOp, WindowResultFunction<? super R,? extends OUT> mapToOutputFn)` Creates and returns a pipeline stage that performs a windowed co-aggregation of the pipeline stages registered with this builder object.
    `<A,R> StreamStage<TimestampedItem<R>>` | `build(AggregateOperation<A,R> aggrOp)` Convenience for `build(aggrOp, mapToOutputFn)` which emits `TimestampedItem`s as output.
    `Tag<T0>` | `tag0()` Returns the tag corresponding to the pipeline stage this builder was obtained from.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### 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 <E> Tag<E> add(StreamStage<E> 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

          @Nonnull
          public <R,OUT> StreamStage<OUT> build(@Nonnull
                                                         AggregateOperation<?,R> aggrOp,
                                                         @Nonnull
                                                         WindowResultFunction<? super R,? extends OUT> mapToOutputFn)

      Creates and returns a pipeline stage that performs a windowed co-aggregation of the 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` - the type of the aggregation result
        `OUT` - the type of the output item
      Parameters:
        `aggrOp` - the aggregate operation to perform
        `mapToOutputFn` - a function that creates the output item from the aggregation result
      Returns:
        a new stage representing the co-aggregation

    - #### build

          @Nonnull
          public <A,R> StreamStage<TimestampedItem<R>> build(@Nonnull
                                                                      AggregateOperation<A,R> aggrOp)

      Convenience for `build(aggrOp, mapToOutputFn)` which emits `TimestampedItem`s as output. The timestamp corresponds to the window's end.
      Type Parameters:
        `A` - the type of items in the pipeline stage this builder was obtained from
        `R` - the type of the aggregation result
      Parameters:
        `aggrOp` - the aggregate operation to perform.
      Returns:
        a new stage representing the co-group-and-aggregate operation

Copyright © 2018. All rights reserved.