Class InMemorySideInputReader

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

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

      • InMemorySideInputReader

        public InMemorySideInputReader​(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.