Class SideInputReaderFactory
java.lang.Object
org.apache.beam.runners.spark.util.SideInputReaderFactory
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.beam.runners.core.SideInputReader
create
(boolean useStreamingSideInput, Map<TupleTag<?>, KV<WindowingStrategy<?, ?>, SideInputBroadcast<?>>> sideInputs) Creates and returns aSideInputReader
based on the configuration.
-
Constructor Details
-
SideInputReaderFactory
public SideInputReaderFactory()
-
-
Method Details
-
create
public static org.apache.beam.runners.core.SideInputReader create(boolean useStreamingSideInput, Map<TupleTag<?>, KV<WindowingStrategy<?, ?>, SideInputBroadcast<?>>> sideInputs) Creates and returns aSideInputReader
based on the configuration.If streaming side inputs are enabled, returns a direct
SparkSideInputReader
. Otherwise, returns a cached version of the side input reader usingCachedSideInputReader
for better performance in batch processing.- Parameters:
useStreamingSideInput
- Whether to use streaming side inputssideInputs
- A map of side inputs with their windowing strategies and broadcasts- Returns:
- A
SideInputReader
instance appropriate for the current configuration
-