Class PolicyBuilder
- java.lang.Object
-
- org.apache.nemo.compiler.optimizer.policy.PolicyBuilder
-
public final class PolicyBuilder extends java.lang.Object
A builder for policies.
-
-
Constructor Summary
Constructors Constructor Description PolicyBuilder()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Policy
build()
Build a policy using compileTimePasses and runTimePasses in this object.java.util.List<CompileTimePass>
getCompileTimePasses()
Getter for compile time passes.java.util.Set<RunTimePass<?>>
getRunTimePasses()
Getter for run time passes.PolicyBuilder
registerCompileTimePass(CompileTimePass compileTimePass)
Register a compile time pass.PolicyBuilder
registerCompileTimePass(CompileTimePass compileTimePass, java.util.function.Predicate<IRDAG> condition)
Register compile time pass with its condition under which to run the pass.PolicyBuilder
registerRunTimePass(RunTimePass<?> runTimePass, CompileTimePass runTimePassRegisterer)
Register a run time pass.PolicyBuilder
registerRunTimePass(RunTimePass<?> runTimePass, CompileTimePass runTimePassRegisterer, java.util.function.Predicate<IRDAG> condition)
Register a run time pass.
-
-
-
Method Detail
-
registerCompileTimePass
public PolicyBuilder registerCompileTimePass(CompileTimePass compileTimePass)
Register a compile time pass.- Parameters:
compileTimePass
- the compile time pass to register.- Returns:
- the PolicyBuilder which registers the compileTimePass.
-
registerCompileTimePass
public PolicyBuilder registerCompileTimePass(CompileTimePass compileTimePass, java.util.function.Predicate<IRDAG> condition)
Register compile time pass with its condition under which to run the pass.- Parameters:
compileTimePass
- the compile time pass to register.condition
- condition under which to run the pass.- Returns:
- the PolicyBuilder which registers the compileTimePass.
-
registerRunTimePass
public PolicyBuilder registerRunTimePass(RunTimePass<?> runTimePass, CompileTimePass runTimePassRegisterer)
Register a run time pass.- Parameters:
runTimePass
- the runtime pass to register.runTimePassRegisterer
- the compile time pass that triggers the runtime pass.- Returns:
- the PolicyBuilder which registers the runTimePass and the runTimePassRegisterer.
-
registerRunTimePass
public PolicyBuilder registerRunTimePass(RunTimePass<?> runTimePass, CompileTimePass runTimePassRegisterer, java.util.function.Predicate<IRDAG> condition)
Register a run time pass.- Parameters:
runTimePass
- the runtime pass to register.runTimePassRegisterer
- the compile time pass that triggers the runtime pass.condition
- condition under which to run the pass.- Returns:
- the PolicyBuilder which registers the runTimePass and the runTimePassRegisterer.
-
getCompileTimePasses
public java.util.List<CompileTimePass> getCompileTimePasses()
Getter for compile time passes.- Returns:
- the list of compile time passes.
-
getRunTimePasses
public java.util.Set<RunTimePass<?>> getRunTimePasses()
Getter for run time passes.- Returns:
- the list of run time passes.
-
build
public Policy build()
Build a policy using compileTimePasses and runTimePasses in this object.- Returns:
- the built Policy.
-
-