public class PactCompiler extends Object
The basic principle is taken from optimizer works in systems such as Volcano/Cascades and Selinger/System-R/DB2. The optimizer walks from the sinks down, generating interesting properties, and ascends from the sources generating alternative plans, pruning against the interesting properties.
The optimizer also assigns the memory to the individual tasks. This is currently done in a very simple fashion: All sub-tasks that need memory (e.g. reduce or join) are given an equal share of memory.
| Modifier and Type | Class and Description |
|---|---|
static class |
PactCompiler.InterestingPropertyVisitor
Visitor that computes the interesting properties for each node in the plan.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
HINT_LOCAL_STRATEGY
Compiler hint key for the operator's local strategy.
|
static String |
HINT_LOCAL_STRATEGY_COMBINING_SORT
Value for the local strategy compiler hint that enforces a sort based local strategy.
|
static String |
HINT_LOCAL_STRATEGY_HASH_BUILD_FIRST
Value for the local strategy compiler hint that enforces a hash based local strategy.
|
static String |
HINT_LOCAL_STRATEGY_HASH_BUILD_SECOND
Value for the local strategy compiler hint that enforces a hash based local strategy.
|
static String |
HINT_LOCAL_STRATEGY_MERGE
Value for the local strategy compiler hint that enforces a merge based local strategy.
|
static String |
HINT_LOCAL_STRATEGY_NESTEDLOOP_BLOCKED_OUTER_FIRST
Value for the local strategy compiler hint that chooses the outer side of the nested-loop local strategy.
|
static String |
HINT_LOCAL_STRATEGY_NESTEDLOOP_BLOCKED_OUTER_SECOND
Value for the local strategy compiler hint that chooses the outer side of the nested-loop local strategy.
|
static String |
HINT_LOCAL_STRATEGY_NESTEDLOOP_STREAMED_OUTER_FIRST
Value for the local strategy compiler hint that chooses the outer side of the nested-loop local strategy.
|
static String |
HINT_LOCAL_STRATEGY_NESTEDLOOP_STREAMED_OUTER_SECOND
Value for the local strategy compiler hint that chooses the outer side of the nested-loop local strategy.
|
static String |
HINT_LOCAL_STRATEGY_SORT
Value for the local strategy compiler hint that enforces a sort based local strategy.
|
static String |
HINT_LOCAL_STRATEGY_SORT_BOTH_MERGE
Value for the local strategy compiler hint that enforces a sort merge based local strategy on both
inputs with subsequent merging of inputs.
|
static String |
HINT_LOCAL_STRATEGY_SORT_FIRST_MERGE
Value for the local strategy compiler hint that enforces a sort merge based local strategy.
|
static String |
HINT_LOCAL_STRATEGY_SORT_SECOND_MERGE
Value for the local strategy compiler hint that enforces a sort merge based local strategy.
|
static String |
HINT_SHIP_STRATEGY
Compiler hint key for the input channel's shipping strategy.
|
static String |
HINT_SHIP_STRATEGY_BROADCAST
Value for the shipping strategy compiler hint that enforces a broadcast strategy on the
input channel.
|
static String |
HINT_SHIP_STRATEGY_FIRST_INPUT
Compiler hint key for the first input channel's shipping strategy.
|
static String |
HINT_SHIP_STRATEGY_FORWARD
Value for the shipping strategy compiler hint that enforces a Forward strategy on the
input channel, i.e.
|
static String |
HINT_SHIP_STRATEGY_REPARTITION
Value for the shipping strategy compiler hint that enforces a random repartition strategy.
|
static String |
HINT_SHIP_STRATEGY_REPARTITION_HASH
Value for the shipping strategy compiler hint that enforces a hash-partition strategy.
|
static String |
HINT_SHIP_STRATEGY_REPARTITION_RANGE
Value for the shipping strategy compiler hint that enforces a range-partition strategy.
|
static String |
HINT_SHIP_STRATEGY_SECOND_INPUT
Compiler hint key for the second input channel's shipping strategy.
|
static org.slf4j.Logger |
LOG
The log handle that is used by the compiler to log messages.
|
| Constructor and Description |
|---|
PactCompiler()
Creates a new compiler instance.
|
PactCompiler(CostEstimator estimator)
Creates a new compiler instance.
|
PactCompiler(DataStatistics stats)
Creates a new compiler instance that uses the statistics object to determine properties about the input.
|
PactCompiler(DataStatistics stats,
CostEstimator estimator)
Creates a new compiler instance that uses the statistics object to determine properties about the input.
|
| Modifier and Type | Method and Description |
|---|---|
OptimizedPlan |
compile(Plan program)
Translates the given plan in to an OptimizedPlan, where all nodes have their local strategy assigned
and all channels have a shipping strategy assigned.
|
static List<DataSinkNode> |
createPreOptimizedPlan(Plan program)
This function performs only the first step to the compilation process - the creation of the optimizer
representation of the plan.
|
int |
getDefaultDegreeOfParallelism() |
void |
setDefaultDegreeOfParallelism(int defaultDegreeOfParallelism) |
public static final String HINT_SHIP_STRATEGY
public static final String HINT_SHIP_STRATEGY_FIRST_INPUT
public static final String HINT_SHIP_STRATEGY_SECOND_INPUT
public static final String HINT_SHIP_STRATEGY_FORWARD
public static final String HINT_SHIP_STRATEGY_REPARTITION
public static final String HINT_SHIP_STRATEGY_REPARTITION_HASH
public static final String HINT_SHIP_STRATEGY_REPARTITION_RANGE
public static final String HINT_SHIP_STRATEGY_BROADCAST
public static final String HINT_LOCAL_STRATEGY
This hint is ignored by operators that do not have a local strategy (such as Map), or by operators that have no choice in their local strategy (such as Cross).
public static final String HINT_LOCAL_STRATEGY_SORT
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_COMBINING_SORT
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_SORT_BOTH_MERGE
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_SORT_FIRST_MERGE
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_SORT_SECOND_MERGE
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_MERGE
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_HASH_BUILD_FIRST
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_HASH_BUILD_SECOND
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_NESTEDLOOP_STREAMED_OUTER_FIRST
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_NESTEDLOOP_STREAMED_OUTER_SECOND
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_NESTEDLOOP_BLOCKED_OUTER_FIRST
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final String HINT_LOCAL_STRATEGY_NESTEDLOOP_BLOCKED_OUTER_SECOND
HINT_LOCAL_STRATEGY,
Constant Field Valuespublic static final org.slf4j.Logger LOG
public PactCompiler()
The address of the job manager (to obtain system characteristics) is determined via the global configuration.
public PactCompiler(DataStatistics stats)
The address of the job manager (to obtain system characteristics) is determined via the global configuration.
stats - The statistics to be used to determine the input properties.public PactCompiler(CostEstimator estimator)
The address of the job manager (to obtain system characteristics) is determined via the global configuration.
estimator - The CostEstimator to use to cost the individual operations.public PactCompiler(DataStatistics stats, CostEstimator estimator)
The address of the job manager (to obtain system characteristics) is determined via the global configuration.
stats - The statistics to be used to determine the input properties.estimator - The CostEstimator to use to cost the individual operations.public int getDefaultDegreeOfParallelism()
public void setDefaultDegreeOfParallelism(int defaultDegreeOfParallelism)
public OptimizedPlan compile(Plan program) throws CompilerException
The compilation process itself goes through several phases:
program - The program to be translated.CompilerException - Thrown, if the plan is invalid or the optimizer encountered an inconsistent
situation during the compilation process.public static List<DataSinkNode> createPreOptimizedPlan(Plan program)
program - The plan to generate the optimizer representation for.Copyright © 2014 The Apache Software Foundation. All rights reserved.