Class NemoPlanRewriter
- java.lang.Object
-
- org.apache.nemo.compiler.backend.nemo.NemoPlanRewriter
-
- All Implemented Interfaces:
PlanRewriter
public final class NemoPlanRewriter extends Object implements PlanRewriter
Rewrites the physical plan during execution, to enforce the optimizations of Nemo RunTimePasses.A high-level flow of a rewrite is as follows: Runtime - (PhysicalPlan-level info) - NemoPlanRewriter - (IRDAG-level info) - NemoOptimizer - (new IRDAG) - NemoPlanRewriter - (new PhysicalPlan) - Runtime
Here, the NemoPlanRewriter acts as a translator between the Runtime that only understands PhysicalPlan-level info, and the NemoOptimizer that only understands IRDAG-level info.
This decoupling between the NemoOptimizer and the Runtime lets Nemo optimization policies dynamically control distributed execution behaviors, and at the same time enjoy correctness/reusability/composability properties that the IRDAG abstraction provides.
-
-
Constructor Summary
Constructors Constructor Description NemoPlanRewriter(NemoOptimizer nemoOptimizer, NemoBackend nemoBackend)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accumulate(int messageId, Object data)
PhysicalPlan
rewrite(PhysicalPlan currentPhysicalPlan, int messageId)
void
setIRDAG(IRDAG irdag)
-
-
-
Constructor Detail
-
NemoPlanRewriter
@Inject public NemoPlanRewriter(NemoOptimizer nemoOptimizer, NemoBackend nemoBackend)
-
-
Method Detail
-
setIRDAG
public void setIRDAG(IRDAG irdag)
-
rewrite
public PhysicalPlan rewrite(PhysicalPlan currentPhysicalPlan, int messageId)
- Specified by:
rewrite
in interfacePlanRewriter
- Parameters:
currentPhysicalPlan
- to rewrite.messageId
- of the rewrite.- Returns:
- physical plan.
-
accumulate
public void accumulate(int messageId, Object data)
- Specified by:
accumulate
in interfacePlanRewriter
- Parameters:
messageId
- of the rewrite.data
- to accumulate.
-
-