org.apache.hadoop.hive.ql.lib
Class TaskGraphWalker

java.lang.Object
  extended by org.apache.hadoop.hive.ql.lib.TaskGraphWalker
All Implemented Interfaces:
GraphWalker

public class TaskGraphWalker
extends Object
implements GraphWalker

base class for operator graph walker this class takes list of starting ops and walks them one by one. it maintains list of walked operators (dispatchedList) and a list of operators that are discovered but not yet dispatched


Nested Class Summary
 class TaskGraphWalker.TaskGraphWalkerContext
           
 
Constructor Summary
TaskGraphWalker(Dispatcher disp)
          Constructor.
 
Method Summary
 void dispatch(Node nd, Stack<Node> ndStack)
           
 void dispatch(Node nd, Stack<Node> ndStack, TaskGraphWalker.TaskGraphWalkerContext walkerCtx)
          Dispatch the current operator.
 Set<Node> getDispatchedList()
           
 List<Node> getToWalk()
           
 void startWalking(Collection<Node> startNodes, HashMap<Node,Object> nodeOutput)
          starting point for walking.
 void walk(Node nd)
          walk the current operator and its descendants.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskGraphWalker

public TaskGraphWalker(Dispatcher disp)
Constructor.

Parameters:
disp - dispatcher to call for each op encountered
Method Detail

getToWalk

public List<Node> getToWalk()
Returns:
the toWalk

getDispatchedList

public Set<Node> getDispatchedList()
Returns:
the doneList

dispatch

public void dispatch(Node nd,
                     Stack<Node> ndStack,
                     TaskGraphWalker.TaskGraphWalkerContext walkerCtx)
              throws SemanticException
Dispatch the current operator.

Parameters:
nd - node being walked
ndStack - stack of nodes encountered
Throws:
SemanticException

dispatch

public void dispatch(Node nd,
                     Stack<Node> ndStack)
              throws SemanticException
Throws:
SemanticException

startWalking

public void startWalking(Collection<Node> startNodes,
                         HashMap<Node,Object> nodeOutput)
                  throws SemanticException
starting point for walking.

Specified by:
startWalking in interface GraphWalker
Parameters:
startNodes - list of starting operators
nodeOutput - If this parameter is not null, the call to the function returns the map from node to objects returned by the processors.
Throws:
SemanticException

walk

public void walk(Node nd)
          throws SemanticException
walk the current operator and its descendants.

Parameters:
nd - current operator in the graph
Throws:
SemanticException


Copyright © 2014 The Apache Software Foundation. All rights reserved.