org.apache.pig.newplan.optimizer
Class Transformer

java.lang.Object
  extended by org.apache.pig.newplan.optimizer.Transformer
Direct Known Subclasses:
AddForEach.AddForEachTransformer, ColumnMapKeyPrune.ColumnMapKeyPruneTransformer, FilterAboveForeach.FilterAboveForEachTransformer, GroupByConstParallelSetter.GroupAllParallelSetterTransformer, ImplicitSplitInserter.ImplicitSplitInserterTransformer, LimitOptimizer.OptimizeLimitTransformer, LogicalExpressionSimplifier.LogicalExpressionSimplifierTransformer, MergeFilter.MergeFilterTransformer, MergeForEach.MergeForEachTransformer, PartitionFilterOptimizer.PartitionFilterPushDownTransformer, PushUpFilter.PushUpFilterTransformer, SplitFilter.SplitFilterTransformer, TypeCastInserter.TypeCastInserterTransformer

public abstract class Transformer
extends Object


Constructor Summary
Transformer()
           
 
Method Summary
abstract  boolean check(OperatorPlan matched)
          check if the transform should be done.
abstract  OperatorPlan reportChanges()
          Report what parts of the tree were transformed.
abstract  void transform(OperatorPlan matched)
          Transform the tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformer

public Transformer()
Method Detail

check

public abstract boolean check(OperatorPlan matched)
                       throws FrontendException
check if the transform should be done. If this is being called then the pattern matches, but there may be other criteria that must be met as well.

Parameters:
matched - the sub-set of the plan that matches the pattern. This subset has the same graph as the pattern, but the operators point to the same objects as the plan to be matched.
Returns:
true if the transform should be done.
Throws:
Transformer
FrontendException

transform

public abstract void transform(OperatorPlan matched)
                        throws FrontendException
Transform the tree

Parameters:
matched - the sub-set of the plan that matches the pattern. This subset has the same graph as the pattern, but the operators point to the same objects as the plan to be matched.
Throws:
Transformer
FrontendException

reportChanges

public abstract OperatorPlan reportChanges()
Report what parts of the tree were transformed. This is so that listeners can know which part of the tree to visit and modify schemas, annotations, etc. So any nodes that were removed need will not be in this plan, only nodes that were added or moved.

Returns:
OperatorPlan that describes just the changed nodes.


Copyright © 2007-2012 The Apache Software Foundation