java.lang.Object
com.pervasive.datarush.operators.ParallelismStrategy
A
ParallelismStrategy is responsible for determining parallelization of an operator based on
configured parallelism and source parallelism.
Implementations should rely on one of the following standard strategies:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParallelismStrategyUses the maximum of the input ports' parallelism as this operator's max parallelism.static final ParallelismStrategyIndicates that the operator should use whatever parallelism has been explicitly configured viaOperatorSettings.getMaxParallelism(), defaulting toEngineConfig#getParallelism().static final ParallelismStrategyUses the maximum of the input ports' parallelism as this operator's max parallelism.static final ParallelismStrategyIndicates that the operator is non-parallelizable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract IntegermaxParallelism(Integer configuredParallelism, MetadataCalculationContext ctx) Public only as a matter of implementation; operators should not call this method.
-
Field Details
-
NON_PARALLELIZABLE
Indicates that the operator is non-parallelizable. -
CONFIGURED
Indicates that the operator should use whatever parallelism has been explicitly configured viaOperatorSettings.getMaxParallelism(), defaulting toEngineConfig#getParallelism(). -
NEGOTIATE_BASED_ON_SOURCE
Uses the maximum of the input ports' parallelism as this operator's max parallelism. If there are no parallel inputs, this will useInteger.MAX_VALUEas its parallelism, forcing a "scatter" from the inputs. If this operator has an explicitOperatorSettings.maxParallelism(int)specified on it or inherited from its parent, this will favor the explicit setting. -
ACCEPT_SOURCE
Uses the maximum of the input ports' parallelism as this operator's max parallelism. In contrast toNEGOTIATE_BASED_ON_SOURCE, parallelism of 1 is a valid value and thus we will only be parallel if the source is parallel. If this operator has an explicitOperatorSettings.maxParallelism(int)specified on it or inherited from its parent, this will favor the explicit setting.
-
-
Constructor Details
-
ParallelismStrategy
public ParallelismStrategy()
-
-
Method Details
-
maxParallelism
public abstract Integer maxParallelism(Integer configuredParallelism, MetadataCalculationContext ctx) Public only as a matter of implementation; operators should not call this method. Computes the max parallelism to use.- Parameters:
configuredParallelism- the parallelism explicitly configured ornullif unspecifiedctx- the context that the function can use to determine port inputs, etc- Returns:
- the max parallelism. a value of null will be interpretted as
Integer.MAX_VALUE(unconstrained).
-