org.apache.pig.newplan
Class DotPlanDumper

java.lang.Object
  extended by org.apache.pig.newplan.PlanDumper
      extended by org.apache.pig.newplan.DotPlanDumper
Direct Known Subclasses:
DotLOPrinter

public class DotPlanDumper
extends PlanDumper

This class puts everything that is needed to dump a plan in a format readable by graphviz's dot algorithm. Out of the box it does not print any nested plans.


Field Summary
protected  Set<Operator> mMultiInputSubgraphs
           
protected  Set<Operator> mMultiOutputSubgraphs
           
protected  Set<Operator> mSubgraphs
           
 
Fields inherited from class org.apache.pig.newplan.PlanDumper
isVerbose, plan, ps
 
Constructor Summary
  DotPlanDumper(BaseOperatorPlan plan, PrintStream ps)
           
protected DotPlanDumper(BaseOperatorPlan plan, PrintStream ps, boolean isSubGraph, Set<Operator> mSubgraphs, Set<Operator> mMultiInputSubgraphs, Set<Operator> mMultiOutputSubgraphs)
           
 
Method Summary
 void dump()
          This is the public interface.
protected  void dumpEdge(Operator op, Operator suc)
          Will be called to dump the edges of the plan.
protected  void dumpInvisibleOperators(Operator op)
           
protected  void dumpMultiInputNestedOperator(Operator op, MultiMap<Operator,BaseOperatorPlan> plans)
          Will be called when an operator has nested plans, which are connected to one of the multiple inputs.
protected  void dumpMultiOutputNestedOperator(Operator op, Collection<BaseOperatorPlan> plans)
          Will be called for nested operators, where the plans represent how the output of the operator is processed.
protected  void dumpNestedOperator(Operator op, Collection<BaseOperatorPlan> plans)
          Will be called for nested operators.
protected  void dumpOperator(Operator op)
          Will be called to dump a simple operator
protected  String[] getAttributes(Operator op)
          Used to generate the the attributes of a node
protected  String getName(Operator op)
          Used to generate the label for an operator.
protected  PlanDumper makeDumper(BaseOperatorPlan plan, PrintStream ps)
          makeDumper is a factory method.
protected  boolean reverse(BaseOperatorPlan plan)
           
 
Methods inherited from class org.apache.pig.newplan.PlanDumper
getMultiInputNestedPlans, getMultiOutputNestedPlans, getNestedPlans, isVerbose, join, setVerbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mSubgraphs

protected Set<Operator> mSubgraphs

mMultiInputSubgraphs

protected Set<Operator> mMultiInputSubgraphs

mMultiOutputSubgraphs

protected Set<Operator> mMultiOutputSubgraphs
Constructor Detail

DotPlanDumper

public DotPlanDumper(BaseOperatorPlan plan,
                     PrintStream ps)

DotPlanDumper

protected DotPlanDumper(BaseOperatorPlan plan,
                        PrintStream ps,
                        boolean isSubGraph,
                        Set<Operator> mSubgraphs,
                        Set<Operator> mMultiInputSubgraphs,
                        Set<Operator> mMultiOutputSubgraphs)
Method Detail

dump

public void dump()
Description copied from class: PlanDumper
This is the public interface. Dump writes the plan and nested plans to the stream.

Overrides:
dump in class PlanDumper

dumpMultiInputNestedOperator

protected void dumpMultiInputNestedOperator(Operator op,
                                            MultiMap<Operator,BaseOperatorPlan> plans)
Description copied from class: PlanDumper
Will be called when an operator has nested plans, which are connected to one of the multiple inputs.

Overrides:
dumpMultiInputNestedOperator in class PlanDumper
Parameters:
op - the nested operator
plans - a map of input operator to connected nested plan

dumpMultiOutputNestedOperator

protected void dumpMultiOutputNestedOperator(Operator op,
                                             Collection<BaseOperatorPlan> plans)
Description copied from class: PlanDumper
Will be called for nested operators, where the plans represent how the output of the operator is processed.

Overrides:
dumpMultiOutputNestedOperator in class PlanDumper
Parameters:
op - the nested operator
plans - a collection of sub plans.

dumpNestedOperator

protected void dumpNestedOperator(Operator op,
                                  Collection<BaseOperatorPlan> plans)
Description copied from class: PlanDumper
Will be called for nested operators. The operators are not specifically connected to any input or output operators of E

Overrides:
dumpNestedOperator in class PlanDumper
Parameters:
op - the nested operator
plans - a collection of sub plans.

dumpOperator

protected void dumpOperator(Operator op)
Description copied from class: PlanDumper
Will be called to dump a simple operator

Overrides:
dumpOperator in class PlanDumper
Parameters:
op - the operator to be dumped

dumpEdge

protected void dumpEdge(Operator op,
                        Operator suc)
Description copied from class: PlanDumper
Will be called to dump the edges of the plan. Each edge results in one call.

Overrides:
dumpEdge in class PlanDumper
Parameters:
op - tail of the edge
suc - head of the edge

makeDumper

protected PlanDumper makeDumper(BaseOperatorPlan 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 PlanDumper
Parameters:
plan - Plan that the new dumper should handle
Returns:
the dumper for plan

getName

protected String getName(Operator op)
Used to generate the label for an operator.

Parameters:
op - operator to dump

getAttributes

protected String[] getAttributes(Operator op)
Used to generate the the attributes of a node

Parameters:
op - operator

dumpInvisibleOperators

protected void dumpInvisibleOperators(Operator op)

reverse

protected boolean reverse(BaseOperatorPlan plan)


Copyright © 2007-2012 The Apache Software Foundation