Class PartialCombineFn<InputT,​AccumT>

  • Type Parameters:
    InputT - input type
    AccumT - accumulator type
    All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT,​AccumT,​AccumT>, org.apache.beam.sdk.transforms.display.HasDisplayData

    public final class PartialCombineFn<InputT,​AccumT>
    extends org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​AccumT>
    Wrapper class for Combine.CombineFn. When invoked to output, it outputs its accumulator, instead of the output from its original combine function.
    See Also:
    Serialized Form
    • Constructor Detail

      • PartialCombineFn

        public PartialCombineFn​(org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​?> originFn,
                                org.apache.beam.sdk.coders.Coder<AccumT> accumCoder)
    • Method Detail

      • createAccumulator

        public AccumT createAccumulator()
        Specified by:
        createAccumulator in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​AccumT>
      • addInput

        public AccumT addInput​(AccumT accumulator,
                               InputT input)
        Specified by:
        addInput in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​AccumT>
      • mergeAccumulators

        public AccumT mergeAccumulators​(java.lang.Iterable<AccumT> accumulators)
        Specified by:
        mergeAccumulators in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​AccumT>
      • extractOutput

        public AccumT extractOutput​(AccumT accumulator)
        Specified by:
        extractOutput in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​AccumT>
      • getAccumulatorCoder

        public org.apache.beam.sdk.coders.Coder<AccumT> getAccumulatorCoder​(org.apache.beam.sdk.coders.CoderRegistry registry,
                                                                            org.apache.beam.sdk.coders.Coder<InputT> inputCoder)
                                                                     throws org.apache.beam.sdk.coders.CannotProvideCoderException
        Specified by:
        getAccumulatorCoder in interface org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT,​AccumT,​AccumT>
        Throws:
        org.apache.beam.sdk.coders.CannotProvideCoderException
      • getDefaultOutputCoder

        public org.apache.beam.sdk.coders.Coder<OutputT> getDefaultOutputCoder​(org.apache.beam.sdk.coders.CoderRegistry arg0,
                                                                               org.apache.beam.sdk.coders.Coder<InputT> arg1)
                                                                        throws org.apache.beam.sdk.coders.CannotProvideCoderException
        Specified by:
        getDefaultOutputCoder in interface org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT extends java.lang.Object,​AccumT extends java.lang.Object,​OutputT extends java.lang.Object>
        Throws:
        org.apache.beam.sdk.coders.CannotProvideCoderException
      • getIncompatibleGlobalWindowErrorMessage

        public java.lang.String getIncompatibleGlobalWindowErrorMessage()
        Specified by:
        getIncompatibleGlobalWindowErrorMessage in interface org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT extends java.lang.Object,​AccumT extends java.lang.Object,​OutputT extends java.lang.Object>
      • getInputTVariable

        public java.lang.reflect.TypeVariable<?> getInputTVariable()
      • getAccumTVariable

        public java.lang.reflect.TypeVariable<?> getAccumTVariable()
      • getOutputTVariable

        public java.lang.reflect.TypeVariable<?> getOutputTVariable()
      • populateDisplayData

        public void populateDisplayData​(org.apache.beam.sdk.transforms.display.DisplayData.Builder arg0)
        Specified by:
        populateDisplayData in interface org.apache.beam.sdk.transforms.display.HasDisplayData