org.apache.hadoop.hive.ql.optimizer
Class GenMRProcContext

java.lang.Object
  extended by org.apache.hadoop.hive.ql.optimizer.GenMRProcContext
All Implemented Interfaces:
NodeProcessorCtx

public class GenMRProcContext
extends Object
implements NodeProcessorCtx

Processor Context for creating map reduce task. Walk the tree in a DFS manner and process the nodes. Some state is maintained about the current nodes visited so far.


Nested Class Summary
static class GenMRProcContext.GenMapRedCtx
          GenMapRedCtx is used to keep track of the current state.
static class GenMRProcContext.GenMRMapJoinCtx
          GenMRMapJoinCtx.
static class GenMRProcContext.GenMRUnionCtx
          GenMRUnionCtx.
 
Constructor Summary
GenMRProcContext()
           
GenMRProcContext(HiveConf conf, HashMap<Operator<? extends Serializable>,Task<? extends Serializable>> opTaskMap, List<Operator<? extends Serializable>> seenOps, ParseContext parseCtx, List<Task<? extends Serializable>> mvTask, List<Task<? extends Serializable>> rootTasks, LinkedHashMap<Operator<? extends Serializable>,GenMRProcContext.GenMapRedCtx> mapCurrCtx, Set<ReadEntity> inputs, Set<WriteEntity> outputs)
           
 
Method Summary
 HiveConf getConf()
           
 String getCurrAliasId()
           
 AbstractMapJoinOperator<? extends MapJoinDesc> getCurrMapJoinOp()
           
 Task<? extends Serializable> getCurrTask()
           
 Operator<? extends Serializable> getCurrTopOp()
           
 UnionOperator getCurrUnionOp()
           
 Set<ReadEntity> getInputs()
          Get the input set.
 LinkedHashMap<Operator<? extends Serializable>,GenMRProcContext.GenMapRedCtx> getMapCurrCtx()
           
 GenMRProcContext.GenMRMapJoinCtx getMapJoinCtx(AbstractMapJoinOperator<? extends MapJoinDesc> op)
           
 List<Task<? extends Serializable>> getMvTask()
           
 HashMap<Operator<? extends Serializable>,Task<? extends Serializable>> getOpTaskMap()
           
 Set<WriteEntity> getOutputs()
          Get the output set.
 ParseContext getParseCtx()
           
 List<Operator<? extends Serializable>> getRootOps()
           
 List<Task<? extends Serializable>> getRootTasks()
           
 List<FileSinkOperator> getSeenFileSinkOps()
           
 List<Operator<? extends Serializable>> getSeenOps()
           
 GenMRProcContext.GenMRUnionCtx getUnionTask(UnionOperator op)
           
 void setConf(HiveConf conf)
           
 void setCurrAliasId(String currAliasId)
           
 void setCurrMapJoinOp(AbstractMapJoinOperator<? extends MapJoinDesc> currMapJoinOp)
           
 void setCurrTask(Task<? extends Serializable> currTask)
           
 void setCurrTopOp(Operator<? extends Serializable> currTopOp)
           
 void setCurrUnionOp(UnionOperator currUnionOp)
           
 void setMapCurrCtx(LinkedHashMap<Operator<? extends Serializable>,GenMRProcContext.GenMapRedCtx> mapCurrCtx)
           
 void setMapJoinCtx(AbstractMapJoinOperator<? extends MapJoinDesc> op, GenMRProcContext.GenMRMapJoinCtx mjCtx)
           
 void setMvTask(List<Task<? extends Serializable>> mvTask)
           
 void setOpTaskMap(HashMap<Operator<? extends Serializable>,Task<? extends Serializable>> opTaskMap)
           
 void setParseCtx(ParseContext parseCtx)
           
 void setRootOps(List<Operator<? extends Serializable>> rootOps)
           
 void setRootTasks(List<Task<? extends Serializable>> rootTasks)
           
 void setSeenFileSinkOps(List<FileSinkOperator> seenFileSinkOps)
           
 void setSeenOps(List<Operator<? extends Serializable>> seenOps)
           
 void setUnionTask(UnionOperator op, GenMRProcContext.GenMRUnionCtx uTask)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenMRProcContext

public GenMRProcContext()

GenMRProcContext

public GenMRProcContext(HiveConf conf,
                        HashMap<Operator<? extends Serializable>,Task<? extends Serializable>> opTaskMap,
                        List<Operator<? extends Serializable>> seenOps,
                        ParseContext parseCtx,
                        List<Task<? extends Serializable>> mvTask,
                        List<Task<? extends Serializable>> rootTasks,
                        LinkedHashMap<Operator<? extends Serializable>,GenMRProcContext.GenMapRedCtx> mapCurrCtx,
                        Set<ReadEntity> inputs,
                        Set<WriteEntity> outputs)
Parameters:
conf - hive configuration
opTaskMap - reducer to task mapping
seenOps - operator already visited
parseCtx - current parse context
rootTasks - root tasks for the plan
mvTask - the final move task
mapCurrCtx - operator to task mappings
inputs - the set of input tables/partitions generated by the walk
outputs - the set of destinations generated by the walk
Method Detail

getOpTaskMap

public HashMap<Operator<? extends Serializable>,Task<? extends Serializable>> getOpTaskMap()
Returns:
reducer to task mapping

setOpTaskMap

public void setOpTaskMap(HashMap<Operator<? extends Serializable>,Task<? extends Serializable>> opTaskMap)
Parameters:
opTaskMap - reducer to task mapping

getSeenOps

public List<Operator<? extends Serializable>> getSeenOps()
Returns:
operators already visited

getSeenFileSinkOps

public List<FileSinkOperator> getSeenFileSinkOps()
Returns:
file operators already visited

setSeenOps

public void setSeenOps(List<Operator<? extends Serializable>> seenOps)
Parameters:
seenOps - operators already visited

setSeenFileSinkOps

public void setSeenFileSinkOps(List<FileSinkOperator> seenFileSinkOps)
Parameters:
seenFileSinkOps - file sink operators already visited

getRootOps

public List<Operator<? extends Serializable>> getRootOps()
Returns:
top operators for tasks

setRootOps

public void setRootOps(List<Operator<? extends Serializable>> rootOps)
Parameters:
rootOps - top operators for tasks

getParseCtx

public ParseContext getParseCtx()
Returns:
current parse context

setParseCtx

public void setParseCtx(ParseContext parseCtx)
Parameters:
parseCtx - current parse context

getMvTask

public List<Task<? extends Serializable>> getMvTask()
Returns:
the final move task

setMvTask

public void setMvTask(List<Task<? extends Serializable>> mvTask)
Parameters:
mvTask - the final move task

getRootTasks

public List<Task<? extends Serializable>> getRootTasks()
Returns:
root tasks for the plan

setRootTasks

public void setRootTasks(List<Task<? extends Serializable>> rootTasks)
Parameters:
rootTasks - root tasks for the plan

getMapCurrCtx

public LinkedHashMap<Operator<? extends Serializable>,GenMRProcContext.GenMapRedCtx> getMapCurrCtx()
Returns:
operator to task mappings

setMapCurrCtx

public void setMapCurrCtx(LinkedHashMap<Operator<? extends Serializable>,GenMRProcContext.GenMapRedCtx> mapCurrCtx)
Parameters:
mapCurrCtx - operator to task mappings

getCurrTask

public Task<? extends Serializable> getCurrTask()
Returns:
current task

setCurrTask

public void setCurrTask(Task<? extends Serializable> currTask)
Parameters:
currTask - current task

getCurrTopOp

public Operator<? extends Serializable> getCurrTopOp()
Returns:
current top operator

setCurrTopOp

public void setCurrTopOp(Operator<? extends Serializable> currTopOp)
Parameters:
currTopOp - current top operator

getCurrUnionOp

public UnionOperator getCurrUnionOp()

setCurrUnionOp

public void setCurrUnionOp(UnionOperator currUnionOp)
Parameters:
currUnionOp - current union operator

getCurrMapJoinOp

public AbstractMapJoinOperator<? extends MapJoinDesc> getCurrMapJoinOp()

setCurrMapJoinOp

public void setCurrMapJoinOp(AbstractMapJoinOperator<? extends MapJoinDesc> currMapJoinOp)
Parameters:
currMapJoinOp - current map join operator

getCurrAliasId

public String getCurrAliasId()
Returns:
current top alias

setCurrAliasId

public void setCurrAliasId(String currAliasId)
Parameters:
currAliasId - current top alias

getUnionTask

public GenMRProcContext.GenMRUnionCtx getUnionTask(UnionOperator op)

setUnionTask

public void setUnionTask(UnionOperator op,
                         GenMRProcContext.GenMRUnionCtx uTask)

getMapJoinCtx

public GenMRProcContext.GenMRMapJoinCtx getMapJoinCtx(AbstractMapJoinOperator<? extends MapJoinDesc> op)

setMapJoinCtx

public void setMapJoinCtx(AbstractMapJoinOperator<? extends MapJoinDesc> op,
                          GenMRProcContext.GenMRMapJoinCtx mjCtx)

getInputs

public Set<ReadEntity> getInputs()
Get the input set.


getOutputs

public Set<WriteEntity> getOutputs()
Get the output set.


getConf

public HiveConf getConf()
Returns:
the conf

setConf

public void setConf(HiveConf conf)
Parameters:
conf - the conf to set


Copyright © 2013 The Apache Software Foundation