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

java.lang.Object
  extended by org.apache.pig.impl.plan.optimizer.PlanOptimizer<O,P>
Direct Known Subclasses:
FunctionalLogicalOptimizer, LogicalOptimizer

public abstract class PlanOptimizer<O extends Operator,P extends OperatorPlan<O>>
extends Object

A class to optimize plans. This class need not be subclassed for a particular type of plan. It can be instantiated with a set of Rules and then optimize called.


Field Summary
protected  P mPlan
           
protected  List<Rule> mRules
           
 
Constructor Summary
protected PlanOptimizer(P plan)
           
 
Method Summary
 void optimize()
          Run the optimizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mRules

protected List<Rule> mRules

mPlan

protected P extends OperatorPlan<O> mPlan
Constructor Detail

PlanOptimizer

protected PlanOptimizer(P plan)
Parameters:
plan - Plan to optimize
Method Detail

optimize

public final void optimize()
                    throws OptimizerException
Run the optimizer. This method attempts to match each of the Rules against the plan. If a Rule matches, it then calls the check method of the associated Transformer to give the it a chance to check whether it really wants to do the optimization. If that returns true as well, then Transformer.transform is called.

Throws:
OptimizerException


Copyright © ${year} The Apache Software Foundation