Class WindowFnTransform<T,​W extends org.apache.beam.sdk.transforms.windowing.BoundedWindow>

  • Type Parameters:
    T - input/output type.
    W - window type
    All Implemented Interfaces:
    Serializable, Transform<org.apache.beam.sdk.util.WindowedValue<T>,​org.apache.beam.sdk.util.WindowedValue<T>>

    public final class WindowFnTransform<T,​W extends org.apache.beam.sdk.transforms.windowing.BoundedWindow>
    extends Object
    implements Transform<org.apache.beam.sdk.util.WindowedValue<T>,​org.apache.beam.sdk.util.WindowedValue<T>>
    Windowing transform implementation. This transform simply windows the given elements into finite windows according to a user-specified WindowFnTransform.
    See Also:
    Serialized Form
    • Constructor Detail

      • WindowFnTransform

        public WindowFnTransform​(org.apache.beam.sdk.transforms.windowing.WindowFn windowFn,
                                 org.apache.beam.sdk.transforms.display.DisplayData displayData)
        Default Constructor.
        Parameters:
        windowFn - windowFn for the Transform.
        displayData - display data.
    • Method Detail

      • prepare

        public void prepare​(Transform.Context context,
                            OutputCollector<org.apache.beam.sdk.util.WindowedValue<T>> oc)
        Description copied from interface: Transform
        Prepare the transform.
        Specified by:
        prepare in interface Transform<T,​W extends org.apache.beam.sdk.transforms.windowing.BoundedWindow>
        Parameters:
        context - of the transform.
        oc - that collects outputs.
      • onData

        public void onData​(org.apache.beam.sdk.util.WindowedValue<T> windowedValue)
        Description copied from interface: Transform
        On data received.
        Specified by:
        onData in interface Transform<T,​W extends org.apache.beam.sdk.transforms.windowing.BoundedWindow>
        Parameters:
        windowedValue - data received.
      • onWatermark

        public void onWatermark​(Watermark watermark)
        Description copied from interface: Transform
        On watermark received. This method should be called for the minimum watermark among input streams (input watermark). Transform may emit collected data after receiving watermarks.
        Specified by:
        onWatermark in interface Transform<T,​W extends org.apache.beam.sdk.transforms.windowing.BoundedWindow>
        Parameters:
        watermark - watermark
      • close

        public void close()
        Description copied from interface: Transform
        Close the transform.
        Specified by:
        close in interface Transform<T,​W extends org.apache.beam.sdk.transforms.windowing.BoundedWindow>