Class InMemorySideInputReader

  • All Implemented Interfaces:
    org.apache.beam.runners.core.ReadyCheckingSideInputReader, org.apache.beam.runners.core.SideInputReader

    public final class InMemorySideInputReader
    extends java.lang.Object
    implements org.apache.beam.runners.core.ReadyCheckingSideInputReader
    Accumulates and provides side inputs in memory.
    • Constructor Summary

      Constructors 
      Constructor Description
      InMemorySideInputReader​(java.util.Collection<org.apache.beam.sdk.values.PCollectionView<?>> sideInputsToRead)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSideInputElement​(org.apache.beam.sdk.values.PCollectionView<?> view, org.apache.beam.sdk.util.WindowedValue<SideInputElement<?>> sideInputElement)
      Stores the side input in memory to be used with main inputs.
      <T> boolean contains​(org.apache.beam.sdk.values.PCollectionView<T> view)  
      <T> T get​(org.apache.beam.sdk.values.PCollectionView<T> view, org.apache.beam.sdk.transforms.windowing.BoundedWindow window)  
      boolean isEmpty()  
      boolean isReady​(org.apache.beam.sdk.values.PCollectionView view, org.apache.beam.sdk.transforms.windowing.BoundedWindow window)  
      void setCurrentWatermarkOfAllMainAndSideInputs​(long newWatermark)
      Say a DoFn of this reader has 3 main inputs and 4 side inputs.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InMemorySideInputReader

        public InMemorySideInputReader​(java.util.Collection<org.apache.beam.sdk.values.PCollectionView<?>> sideInputsToRead)
        Parameters:
        sideInputsToRead - side inputs to read.
    • Method Detail

      • isReady

        public boolean isReady​(org.apache.beam.sdk.values.PCollectionView view,
                               org.apache.beam.sdk.transforms.windowing.BoundedWindow window)
        Specified by:
        isReady in interface org.apache.beam.runners.core.ReadyCheckingSideInputReader
      • get

        @Nullable
        public <T> T get​(org.apache.beam.sdk.values.PCollectionView<T> view,
                         org.apache.beam.sdk.transforms.windowing.BoundedWindow window)
        Specified by:
        get in interface org.apache.beam.runners.core.SideInputReader
      • contains

        public <T> boolean contains​(org.apache.beam.sdk.values.PCollectionView<T> view)
        Specified by:
        contains in interface org.apache.beam.runners.core.SideInputReader
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface org.apache.beam.runners.core.SideInputReader
      • addSideInputElement

        public void addSideInputElement​(org.apache.beam.sdk.values.PCollectionView<?> view,
                                        org.apache.beam.sdk.util.WindowedValue<SideInputElement<?>> sideInputElement)
        Stores the side input in memory to be used with main inputs.
        Parameters:
        view - of the side input.
        sideInputElement - to add.
      • setCurrentWatermarkOfAllMainAndSideInputs

        public void setCurrentWatermarkOfAllMainAndSideInputs​(long newWatermark)
        Say a DoFn of this reader has 3 main inputs and 4 side inputs. Nemo runtime guarantees that the watermark here is the minimum of the all 7 input streams.
        Parameters:
        newWatermark - to set.