org.apache.pig.newplan.logical.rules
Class WholePlanRule
java.lang.Object
org.apache.pig.newplan.optimizer.Rule
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WholePlanRule
public WholePlanRule(String n,
boolean mandatory)
match
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.
See class description above for limitations on the patterns supported.
- Overrides:
match
in class Rule
- Parameters:
plan
- the OperatorPlan to look for matches to the pattern
- Returns:
- 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.
buildPattern
protected OperatorPlan buildPattern()
- Description copied from class:
Rule
- Build the pattern that this rule will look for
- Specified by:
buildPattern
in class Rule
- Returns:
- the pattern to look for by this rule
Copyright © 2012 The Apache Software Foundation