org.apache.pig.impl.plan.optimizer
Class Rule<O extends Operator,P extends OperatorPlan<O>>

java.lang.Object
  extended by org.apache.pig.impl.plan.optimizer.Rule<O,P>

public class Rule<O extends Operator,P extends OperatorPlan<O>>
extends Object

A rule for optimizing a plan. The rule contains a pattern that must be matched in the plan before the optimizer can consider applying the rule and a transformer to do further checks and possibly transform the plan. The rule pattern is expressed as a list of node names, a map of edges in the plan, and a list of boolean values indicating whether the node is required. For example, a rule pattern could be expressed as: [Filter, Filter] {[0, 1]} [true, true], which would indicate this rule matches two nodes of class name Filter, with an edge between the two, and both are required.


Nested Class Summary
static class Rule.WalkerAlgo
           
 
Constructor Summary
Rule(RulePlan plan, Transformer<O,P> t, String ruleName)
           
Rule(RulePlan plan, Transformer<O,P> t, String ruleName, Rule.WalkerAlgo al)
           
 
Method Summary
 RulePlan getPlan()
           
 String getRuleName()
           
 Transformer<O,P> getTransformer()
           
 Rule.WalkerAlgo getWalkerAlgo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rule

public Rule(RulePlan plan,
            Transformer<O,P> t,
            String ruleName)
Parameters:
plan - pattern to look for
t - Transformer to apply if the rule matches.

Rule

public Rule(RulePlan plan,
            Transformer<O,P> t,
            String ruleName,
            Rule.WalkerAlgo al)
Parameters:
plan - pattern to look for
t - Transformer to apply if the rule matches.
al - Walker algorithm to find rule match within the plan.
Method Detail

getPlan

public RulePlan getPlan()

getTransformer

public Transformer<O,P> getTransformer()

getRuleName

public String getRuleName()

getWalkerAlgo

public Rule.WalkerAlgo getWalkerAlgo()


Copyright © ${year} The Apache Software Foundation