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 OperatorDesc>,Task<? extends Serializable>> opTaskMap, List<Operator<? extends OperatorDesc>> seenOps, ParseContext parseCtx, List<Task<MoveWork>> mvTask, List<Task<? extends Serializable>> rootTasks, LinkedHashMap<Operator<? extends OperatorDesc>,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 OperatorDesc> getCurrTopOp()
           
 UnionOperator getCurrUnionOp()
           
 DependencyCollectionTask getDependencyTaskForMultiInsert()
          Returns dependencyTaskForMultiInsert initializing it if necessary.
 Set<ReadEntity> getInputs()
          Get the input set.
 Map<FileSinkDesc,Task<? extends Serializable>> getLinkedFileDescTasks()
           
 LinkedHashMap<Operator<? extends OperatorDesc>,GenMRProcContext.GenMapRedCtx> getMapCurrCtx()
           
 GenMRProcContext.GenMRMapJoinCtx getMapJoinCtx(AbstractMapJoinOperator<? extends MapJoinDesc> op)
           
 List<Task<MoveWork>> getMvTask()
           
 HashMap<Operator<? extends OperatorDesc>,Task<? extends Serializable>> getOpTaskMap()
           
 Set<WriteEntity> getOutputs()
          Get the output set.
 ParseContext getParseCtx()
           
 List<Operator<? extends OperatorDesc>> getRootOps()
           
 List<Task<? extends Serializable>> getRootTasks()
           
 List<FileSinkOperator> getSeenFileSinkOps()
           
 List<Operator<? extends OperatorDesc>> 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 OperatorDesc> currTopOp)
           
 void setCurrUnionOp(UnionOperator currUnionOp)
           
 void setLinkedFileDescTasks(Map<FileSinkDesc,Task<? extends Serializable>> linkedFileDescTasks)
           
 void setMapCurrCtx(LinkedHashMap<Operator<? extends OperatorDesc>,GenMRProcContext.GenMapRedCtx> mapCurrCtx)
           
 void setMapJoinCtx(AbstractMapJoinOperator<? extends MapJoinDesc> op, GenMRProcContext.GenMRMapJoinCtx mjCtx)
           
 void setMvTask(List<Task<MoveWork>> mvTask)
           
 void setOpTaskMap(HashMap<Operator<? extends OperatorDesc>,Task<? extends Serializable>> opTaskMap)
           
 void setParseCtx(ParseContext parseCtx)
           
 void setRootOps(List<Operator<? extends OperatorDesc>> rootOps)
           
 void setRootTasks(List<Task<? extends Serializable>> rootTasks)
           
 void setSeenFileSinkOps(List<FileSinkOperator> seenFileSinkOps)
           
 void setSeenOps(List<Operator<? extends OperatorDesc>> 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 OperatorDesc>,Task<? extends Serializable>> opTaskMap,
                        List<Operator<? extends OperatorDesc>> seenOps,
                        ParseContext parseCtx,
                        List<Task<MoveWork>> mvTask,
                        List<Task<? extends Serializable>> rootTasks,
                        LinkedHashMap<Operator<? extends OperatorDesc>,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 OperatorDesc>,Task<? extends Serializable>> getOpTaskMap()
Returns:
reducer to task mapping

setOpTaskMap

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

getSeenOps

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

getSeenFileSinkOps

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

setSeenOps

public void setSeenOps(List<Operator<? extends OperatorDesc>> 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 OperatorDesc>> getRootOps()
Returns:
top operators for tasks

setRootOps

public void setRootOps(List<Operator<? extends OperatorDesc>> 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<MoveWork>> getMvTask()
Returns:
the final move task

setMvTask

public void setMvTask(List<Task<MoveWork>> 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 OperatorDesc>,GenMRProcContext.GenMapRedCtx> getMapCurrCtx()
Returns:
operator to task mappings

setMapCurrCtx

public void setMapCurrCtx(LinkedHashMap<Operator<? extends OperatorDesc>,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 OperatorDesc> getCurrTopOp()
Returns:
current top operator

setCurrTopOp

public void setCurrTopOp(Operator<? extends OperatorDesc> 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

getDependencyTaskForMultiInsert

public DependencyCollectionTask getDependencyTaskForMultiInsert()
Returns dependencyTaskForMultiInsert initializing it if necessary. dependencyTaskForMultiInsert serves as a mutual dependency for the final move tasks in a multi-insert query.

Returns:

getLinkedFileDescTasks

public Map<FileSinkDesc,Task<? extends Serializable>> getLinkedFileDescTasks()

setLinkedFileDescTasks

public void setLinkedFileDescTasks(Map<FileSinkDesc,Task<? extends Serializable>> linkedFileDescTasks)


Copyright © 2013 The Apache Software Foundation