public abstract class ParallelismStrategy extends Object
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:
Modifier and Type | Field and Description |
---|---|
static ParallelismStrategy |
ACCEPT_SOURCE
Uses the maximum of the input ports' parallelism as this operator's max parallelism.
|
static ParallelismStrategy |
CONFIGURED
Indicates that the operator should use whatever parallelism has been explicitly configured via
OperatorSettings.getMaxParallelism() , defaulting to EngineConfig#getParallelism() . |
static ParallelismStrategy |
NEGOTIATE_BASED_ON_SOURCE
Uses the maximum of the input ports' parallelism as this
operator's max parallelism.
|
static ParallelismStrategy |
NON_PARALLELIZABLE
Indicates that the operator is non-parallelizable.
|
Constructor and Description |
---|
ParallelismStrategy() |
Modifier and Type | Method and Description |
---|---|
abstract Integer |
maxParallelism(Integer configuredParallelism,
MetadataCalculationContext ctx)
Public only as a matter of implementation; operators should not call this method.
|
public static final ParallelismStrategy NON_PARALLELIZABLE
public static final ParallelismStrategy CONFIGURED
OperatorSettings.getMaxParallelism()
, defaulting to EngineConfig#getParallelism()
.public static final ParallelismStrategy NEGOTIATE_BASED_ON_SOURCE
Integer.MAX_VALUE
as its parallelism, forcing a "scatter" from the inputs. If this operator has an
explicit OperatorSettings.maxParallelism(int)
specified on it or inherited from its parent, this will favor
the explicit setting.public static final ParallelismStrategy ACCEPT_SOURCE
NEGOTIATE_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
explicit OperatorSettings.maxParallelism(int)
specified on it or inherited from its parent, this will favor
the explicit setting.public abstract Integer maxParallelism(Integer configuredParallelism, MetadataCalculationContext ctx)
configuredParallelism
- the parallelism explicitly configured or null
if unspecifiedctx
- the context that the function can use to determine port inputs, etcInteger.MAX_VALUE
(unconstrained).Copyright © 2024 Actian Corporation. All rights reserved.