org.eigenbase.relopt.volcano
Class VolcanoRuleCall

java.lang.Object
  extended by org.eigenbase.relopt.RelOptRuleCall
      extended by org.eigenbase.relopt.volcano.VolcanoRuleCall
Direct Known Subclasses:
VolcanoPlanner.DeferringRuleCall, VolcanoRuleMatch

public class VolcanoRuleCall
extends RelOptRuleCall

VolcanoRuleCall implements the RelOptRuleCall interface for VolcanoPlanner.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/relopt/volcano/VolcanoRuleCall.java#2 $
Author:
jhyde

Field Summary
private  List<RelNode> generatedRelList
          List of RelNode generated by this call.
protected  VolcanoPlanner volcanoPlanner
           
 
Fields inherited from class org.eigenbase.relopt.RelOptRuleCall
rels, tracer
 
Constructor Summary
(package private) VolcanoRuleCall(VolcanoPlanner planner, RelOptRuleOperand operand)
          Creates a rule call.
protected VolcanoRuleCall(VolcanoPlanner planner, RelOptRuleOperand operand, RelNode[] rels)
          Creates a rule call, internal, with array to hold bindings.
 
Method Summary
(package private)  void match(RelNode rel)
          Applies this rule, with a given relexp in the first slot.
private  void matchRecurse(int solve)
          Recursively matches operands above a given solve order.
protected  void onMatch()
          Called when all operands have matched.
 void transformTo(RelNode rel)
          Called by the rule whenever it finds a match.
 
Methods inherited from class org.eigenbase.relopt.RelOptRuleCall
getChildRels, getOperand0, getParents, getPlanner, getRels, getRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

volcanoPlanner

protected final VolcanoPlanner volcanoPlanner

generatedRelList

private List<RelNode> generatedRelList
List of RelNode generated by this call. For debugging purposes.

Constructor Detail

VolcanoRuleCall

protected VolcanoRuleCall(VolcanoPlanner planner,
                          RelOptRuleOperand operand,
                          RelNode[] rels)
Creates a rule call, internal, with array to hold bindings.

Parameters:
planner - Planner
operand - First operand of the rule
rels - Array which will hold the matched relational expressions

VolcanoRuleCall

VolcanoRuleCall(VolcanoPlanner planner,
                RelOptRuleOperand operand)
Creates a rule call.

Parameters:
planner - Planner
operand - First operand of the rule
Method Detail

transformTo

public void transformTo(RelNode rel)
Description copied from class: RelOptRuleCall
Called by the rule whenever it finds a match. The implementation of this method will guarantee that the original relational expression (e.g., this.rels[0]) has its traits propagated to the new relational expression (rel) and its unregistered children. Any trait not specifically set in the RelTraitSet returned by rel.getTraits() will be copied from this.rels[0].getTraitSet().

Specified by:
transformTo in class RelOptRuleCall

onMatch

protected void onMatch()
Called when all operands have matched.

"Precondition:"
getRule().matches(this)

match

void match(RelNode rel)
Applies this rule, with a given relexp in the first slot.

"Precondition:"
operand0.matches(rel)

matchRecurse

private void matchRecurse(int solve)
Recursively matches operands above a given solve order.

Parameters:
solve - Solver order of operand
"Precondition:"
solve > 0, solve <= rule.operands.length