org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.plans
Class DotMRPrinter

java.lang.Object
  extended by org.apache.pig.impl.plan.PlanDumper<E,P,S>
      extended by org.apache.pig.impl.plan.DotPlanDumper<MapReduceOper,MROperPlan,DotMRPrinter.InnerOperator,DotMRPrinter.InnerPlan>
          extended by org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.plans.DotMRPrinter

public class DotMRPrinter
extends DotPlanDumper<MapReduceOper,MROperPlan,DotMRPrinter.InnerOperator,DotMRPrinter.InnerPlan>

This class can print an MR plan in the DOT format. It uses clusters to illustrate nesting. If "verbose" is off, it will skip any nesting in the associated physical plans.


Nested Class Summary
static class DotMRPrinter.InnerOperator
          Helper class to represent the relationship of map, reduce and combine phases in an MR operator.
static class DotMRPrinter.InnerPlan
          Helper class to represent the relationship of map, reduce and combine phases in an MR operator.
 
Field Summary
 
Fields inherited from class org.apache.pig.impl.plan.DotPlanDumper
mMultiInputSubgraphs, mMultiOutputSubgraphs, mSubgraphs
 
Fields inherited from class org.apache.pig.impl.plan.PlanDumper
isVerbose, plan, ps
 
Constructor Summary
DotMRPrinter(MROperPlan plan, PrintStream ps)
           
 
Method Summary
protected  String[] getAttributes(MapReduceOper op)
          Used to generate the the attributes of a node
protected  String getName(MapReduceOper op)
          Used to generate the label for an operator.
protected  Collection<DotMRPrinter.InnerPlan> getNestedPlans(MapReduceOper op)
          Used to determine if an operator has nested plans (without connections to in- or output operators.
protected  DotPlanDumper makeDumper(DotMRPrinter.InnerPlan plan, PrintStream ps)
          makeDumper is a factory method.
 void setVerbose(boolean verbose)
           
 
Methods inherited from class org.apache.pig.impl.plan.DotPlanDumper
dump, dumpEdge, dumpInvisibleOperators, dumpMultiInputNestedOperator, dumpMultiOutputNestedOperator, dumpNestedOperator, dumpOperator
 
Methods inherited from class org.apache.pig.impl.plan.PlanDumper
getMultiInputNestedPlans, getMultiOutputNestedPlans, isVerbose, join
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotMRPrinter

public DotMRPrinter(MROperPlan plan,
                    PrintStream ps)
Method Detail

setVerbose

public void setVerbose(boolean verbose)
Overrides:
setVerbose in class PlanDumper<MapReduceOper,MROperPlan,DotMRPrinter.InnerPlan>

makeDumper

protected DotPlanDumper makeDumper(DotMRPrinter.InnerPlan plan,
                                   PrintStream ps)
Description copied from class: PlanDumper
makeDumper is a factory method. Used by subclasses to specify what dumper should handle the nested plan.

Overrides:
makeDumper in class DotPlanDumper<MapReduceOper,MROperPlan,DotMRPrinter.InnerOperator,DotMRPrinter.InnerPlan>
Parameters:
plan - Plan that the new dumper should handle
Returns:
the dumper for plan

getName

protected String getName(MapReduceOper op)
Description copied from class: DotPlanDumper
Used to generate the label for an operator.

Overrides:
getName in class DotPlanDumper<MapReduceOper,MROperPlan,DotMRPrinter.InnerOperator,DotMRPrinter.InnerPlan>
Parameters:
op - operator to dump

getNestedPlans

protected Collection<DotMRPrinter.InnerPlan> getNestedPlans(MapReduceOper op)
Description copied from class: PlanDumper
Used to determine if an operator has nested plans (without connections to in- or output operators.

Overrides:
getNestedPlans in class PlanDumper<MapReduceOper,MROperPlan,DotMRPrinter.InnerPlan>
Parameters:
op - operator
Returns:
Collection of nested plans.

getAttributes

protected String[] getAttributes(MapReduceOper op)
Description copied from class: DotPlanDumper
Used to generate the the attributes of a node

Overrides:
getAttributes in class DotPlanDumper<MapReduceOper,MROperPlan,DotMRPrinter.InnerOperator,DotMRPrinter.InnerPlan>
Parameters:
op - operator


Copyright © ${year} The Apache Software Foundation