Class SideInputReaderFactory


  • public class SideInputReaderFactory
    extends java.lang.Object
    Utility class for creating and managing side input readers in the Spark runner.

    This class provides factory methods to create appropriate SideInputReader implementations based on the execution mode (streaming or batch) to optimize side input access patterns.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.beam.runners.core.SideInputReader create​(boolean useStreamingSideInput, java.util.Map<org.apache.beam.sdk.values.TupleTag<?>,​org.apache.beam.sdk.values.KV<org.apache.beam.sdk.values.WindowingStrategy<?,​?>,​SideInputBroadcast<?>>> sideInputs)
      Creates and returns a SideInputReader based on the configuration.
      • Methods inherited from class java.lang.Object

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

      • SideInputReaderFactory

        public SideInputReaderFactory()
    • Method Detail

      • create

        public static org.apache.beam.runners.core.SideInputReader create​(boolean useStreamingSideInput,
                                                                          java.util.Map<org.apache.beam.sdk.values.TupleTag<?>,​org.apache.beam.sdk.values.KV<org.apache.beam.sdk.values.WindowingStrategy<?,​?>,​SideInputBroadcast<?>>> sideInputs)
        Creates and returns a SideInputReader based on the configuration.

        If streaming side inputs are enabled, returns a direct SparkSideInputReader. Otherwise, returns a cached version of the side input reader using CachedSideInputReader for better performance in batch processing.

        Parameters:
        useStreamingSideInput - Whether to use streaming side inputs
        sideInputs - A map of side inputs with their windowing strategies and broadcasts
        Returns:
        A SideInputReader instance appropriate for the current configuration