Class TypedCombineFnDelegate<InputT,​AccumT,​OutputT>

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

    public class TypedCombineFnDelegate<InputT,​AccumT,​OutputT>
    extends org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​OutputT>
    A Combine.CombineFn delegating all relevant calls to given delegate. This is used to create a type anonymous class for cases where the CombineFn is a generic class. The anonymous class can then be used in a UDAF as
       .registerUdaf("UDAF", new TypedCombineFnDelegate<>(genericCombineFn) {})
     
    See Also:
    Serialized Form
    • Constructor Detail

      • TypedCombineFnDelegate

        protected TypedCombineFnDelegate​(org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​OutputT> delegate)
    • Method Detail

      • getOutputType

        public org.apache.beam.sdk.values.TypeDescriptor<OutputT> getOutputType()
        Overrides:
        getOutputType in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​OutputT>
      • getInputType

        public org.apache.beam.sdk.values.TypeDescriptor<InputT> getInputType()
        Overrides:
        getInputType in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​OutputT>
      • createAccumulator

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

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

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

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

        public AccumT compact​(AccumT accumulator)
        Overrides:
        compact in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​OutputT>
      • apply

        public OutputT apply​(java.lang.Iterable<? extends InputT> inputs)
        Overrides:
        apply in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​OutputT>
      • defaultValue

        public OutputT defaultValue()
        Specified by:
        defaultValue in interface org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT,​AccumT,​OutputT>
        Overrides:
        defaultValue in class org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,​AccumT,​OutputT>
      • 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,​OutputT>
        Throws:
        org.apache.beam.sdk.coders.CannotProvideCoderException
      • getDefaultOutputCoder

        public org.apache.beam.sdk.coders.Coder<OutputT> getDefaultOutputCoder​(org.apache.beam.sdk.coders.CoderRegistry registry,
                                                                               org.apache.beam.sdk.coders.Coder<InputT> inputCoder)
                                                                        throws org.apache.beam.sdk.coders.CannotProvideCoderException
        Specified by:
        getDefaultOutputCoder in interface org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT,​AccumT,​OutputT>
        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,​AccumT,​OutputT>
      • 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 builder)
        Specified by:
        populateDisplayData in interface org.apache.beam.sdk.transforms.display.HasDisplayData