Class WholePlanRule

  extended by org.apache.pig.newplan.optimizer.Rule
      extended by org.apache.pig.newplan.logical.rules.WholePlanRule
Direct Known Subclasses:
AddForEach, ColumnMapKeyPrune

public abstract class WholePlanRule
extends Rule

Super class for all rules that operates on the whole plan. It doesn't look for a specific pattern. An example of such kind rule is ColumnPrune.

Field Summary
Fields inherited from class org.apache.pig.newplan.optimizer.Rule
currentPlan, log, name, pattern
Constructor Summary
WholePlanRule(String n, boolean mandatory)
Method Summary
protected  OperatorPlan buildPattern()
          Build the pattern that this rule will look for
 List<OperatorPlan> match(OperatorPlan plan)
          Search for all the sub-plans that matches the pattern defined by this rule.
Methods inherited from class org.apache.pig.newplan.optimizer.Rule
getName, getNewTransformer, getPattern, isMandatory, isSkipListener, setSkipListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public WholePlanRule(String n,
                     boolean mandatory)
Method Detail


public List<OperatorPlan> match(OperatorPlan plan)
Description copied from class: Rule
Search for all the sub-plans that matches the pattern defined by this rule.

match in class Rule
plan - the OperatorPlan to look for matches to the pattern
A list of all matched sub-plans. The returned plans are partial views of the original OperatorPlan. Each is a sub-set of the original plan and represents the same topology as the pattern, but operators in the returned plan are the same objects as the original plan. Therefore, a call getPlan() from any node in the return plan would return the original plan.


protected OperatorPlan buildPattern()
Description copied from class: Rule
Build the pattern that this rule will look for

Specified by:
buildPattern in class Rule
the pattern to look for by this rule

Copyright © ${year} The Apache Software Foundation