Interface SparkCombineFn.WindowedAccumulator<InputT,ValueT,AccumT,ImplT extends SparkCombineFn.WindowedAccumulator<InputT,ValueT,AccumT,ImplT>>

Enclosing class:
SparkCombineFn<InputT,ValueT,AccumT,OutputT>

public static interface SparkCombineFn.WindowedAccumulator<InputT,ValueT,AccumT,ImplT extends SparkCombineFn.WindowedAccumulator<InputT,ValueT,AccumT,ImplT>>
Accumulator of WindowedValues holding values for different windows.
  • Method Details

    • isEmpty

      boolean isEmpty()
      Check if this accumulator is empty.
      Returns:
      true if this accumulator is empty
    • add

      void add(org.apache.beam.sdk.values.WindowedValue<InputT> value, SparkCombineFn<InputT,ValueT,AccumT,?> context) throws Exception
      Add value with unexploded windows into the accumulator.
      Throws:
      Exception
    • merge

      void merge(ImplT other, SparkCombineFn<?,?,AccumT,?> context) throws Exception
      Merge other accumulator into this one.
      Parameters:
      other - the other accumulator to merge
      Throws:
      Exception
    • extractOutput

      Collection<org.apache.beam.sdk.values.WindowedValue<AccumT>> extractOutput()
      Extract output.
    • create

      static <InputT, ValueT, AccumT> SparkCombineFn.WindowedAccumulator<InputT,ValueT,AccumT,?> create(SparkCombineFn<InputT,ValueT,AccumT,?> context, org.apache.spark.api.java.function.Function<InputT,ValueT> toValue, org.apache.beam.sdk.values.WindowingStrategy<?,?> windowingStrategy, Comparator<org.apache.beam.sdk.transforms.windowing.BoundedWindow> windowComparator)
      Create concrete accumulator for given type.
    • create

      static <InputT, ValueT, AccumT> SparkCombineFn.WindowedAccumulator<InputT,ValueT,AccumT,?> create(org.apache.spark.api.java.function.Function<InputT,ValueT> toValue, SparkCombineFn.WindowedAccumulator.Type type, Comparator<org.apache.beam.sdk.transforms.windowing.BoundedWindow> windowComparator)
    • create

      static <InputT, ValueT, AccumT> SparkCombineFn.WindowedAccumulator<InputT,ValueT,AccumT,?> create(org.apache.spark.api.java.function.Function<InputT,ValueT> toValue, SparkCombineFn.WindowedAccumulator.Type type, Iterable<org.apache.beam.sdk.values.WindowedValue<AccumT>> values, Comparator<org.apache.beam.sdk.transforms.windowing.BoundedWindow> windowComparator)
      Create concrete accumulator for given type.