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

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

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

RuleMatcher contains the logic to determine whether a given rule matches. This alone does not mean the rule will be applied. Transformer.check() still has to pass before Transfomer.transform() is called.


Constructor Summary
RuleMatcher()
           
 
Method Summary
 List<List<O>> getAllMatches()
           
 boolean match(Rule<O,P> rule)
          Test a rule to see if it matches the current plan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleMatcher

public RuleMatcher()
Method Detail

match

public boolean match(Rule<O,P> rule)
              throws OptimizerException
Test a rule to see if it matches the current plan. Save all matched nodes using BFS

Parameters:
rule - Rule to test for a match.
Returns:
true if the plan matches.
Throws:
OptimizerException

getAllMatches

public List<List<O>> getAllMatches()
Returns:
all occurrences of matches. lists of nodes that with the instances of nodes that matched the pattern defined by the rule. The nodes will be in the vector in the order they are specified in the rule.


Copyright © ${year} The Apache Software Foundation