|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.relopt.hep.HepProgramBuilder
public class HepProgramBuilder
HepProgramBuilder creates instances of HepProgram
.
Field Summary | |
---|---|
private HepInstruction.BeginGroup |
group
|
private List<HepInstruction> |
instructions
|
Constructor Summary | |
---|---|
HepProgramBuilder()
Creates a new HepProgramBuilder with an initially empty program. |
Method Summary | ||
---|---|---|
void |
addCommonRelSubExprInstruction()
Adds an instruction to attempt to match instances of CommonRelSubExprRule , but only in cases where vertices have more
than one parent. |
|
void |
addConverters(boolean guaranteed)
Adds an instruction to attempt to match instances of ConverterRule , but only where a conversion is actually required. |
|
void |
addGroupBegin()
Adds an instruction to begin a group of rules. |
|
void |
addGroupEnd()
Adds an instruction to end a group of rules, firing the group collectively. |
|
void |
addMatchLimit(int limit)
Adds an instruction to limit the number of pattern matches for subsequent instructions. |
|
void |
addMatchOrder(HepMatchOrder order)
Adds an instruction to change the order of pattern matching for subsequent instructions. |
|
void |
addRuleByDescription(String ruleDescription)
Adds an instruction to attempt to match a specific rule identified by its unique description. |
|
|
addRuleClass(Class<R> ruleClass)
Adds an instruction to attempt to match any rules of a given class. |
|
void |
addRuleCollection(Collection<RelOptRule> rules)
Adds an instruction to attempt to match any rules in a given collection. |
|
void |
addRuleInstance(RelOptRule rule)
Adds an instruction to attempt to match a specific rule object. |
|
void |
addSubprogram(HepProgram program)
Adds an instruction to execute a subprogram. |
|
private void |
clear()
|
|
HepProgram |
createProgram()
Returns the constructed program, clearing the state of this program builder as a side-effect. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private List<HepInstruction> instructions
private HepInstruction.BeginGroup group
Constructor Detail |
---|
public HepProgramBuilder()
HepMatchOrder.ARBITRARY
, and an initial match limit of HepProgram.MATCH_UNTIL_FIXPOINT
.
Method Detail |
---|
private void clear()
public <R extends RelOptRule> void addRuleClass(Class<R> ruleClass)
Note that when this method is used, it is also necessary to add the
actual rule objects of interest to the planner via RelOptPlanner.addRule(org.eigenbase.relopt.RelOptRule)
. If the planner does not have any rules of the
given class, this instruction is a nop.
TODO: support classification via rule annotations.
ruleClass
- class of rules to fire, e.g. ConverterRule.classpublic void addRuleCollection(Collection<RelOptRule> rules)
Note that when this method is used, it is NOT necessary to add the
rules to the planner via RelOptPlanner.addRule(org.eigenbase.relopt.RelOptRule)
; the instances
supplied here will be used. However, adding the rules to the planner
redundantly is good form since other planners may require it.
rules
- collection of rules to firepublic void addRuleInstance(RelOptRule rule)
Note that when this method is used, it is NOT necessary to add the
rule to the planner via RelOptPlanner.addRule(org.eigenbase.relopt.RelOptRule)
; the instance
supplied here will be used. However, adding the rule to the planner
redundantly is good form since other planners may require it.
rule
- rule to firepublic void addRuleByDescription(String ruleDescription)
Note that when this method is used, it is necessary to also add the
rule object of interest to the planner via RelOptPlanner.addRule(org.eigenbase.relopt.RelOptRule)
.
This allows for some decoupling between optimizers and plugins: the
optimizer only knows about rule descriptions, while the plugins supply
the actual instances. If the planner does not have a rule matching the
description, this instruction is a nop.
ruleDescription
- description of rule to firepublic void addGroupBegin()
public void addGroupEnd()
public void addConverters(boolean guaranteed)
ConverterRule
, but only where a conversion is actually required.
guaranteed
- if true, use only guaranteed converters; if false, use
only non-guaranteed converterspublic void addCommonRelSubExprInstruction()
CommonRelSubExprRule
, but only in cases where vertices have more
than one parent.
public void addMatchOrder(HepMatchOrder order)
order
- new match direction to setpublic void addMatchLimit(int limit)
limit
- limit to set; use HepProgram.MATCH_UNTIL_FIXPOINT
to
remove limitpublic void addSubprogram(HepProgram program)
The subprogram has its own state for match order and limit (initialized to the defaults every time the subprogram is executed) and any changes it makes to those settings do not affect the parent program.
program
- subprogram to executepublic HepProgram createProgram()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |