org.apache.hadoop.hive.ql.optimizer
Class GenMRProcContext
java.lang.Object
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenMRProcContext
public GenMRProcContext()
GenMRProcContext
public GenMRProcContext(HiveConf conf,
HashMap<Operator<? extends OperatorDesc>,Task<? extends Serializable>> opTaskMap,
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 configurationopTaskMap - reducer to task mappingseenOps - operator already visitedparseCtx - current parse contextrootTasks - root tasks for the planmvTask - the final move taskmapCurrCtx - operator to task mappingsinputs - the set of input tables/partitions generated by the walkoutputs - the set of destinations generated by the walk
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
isSeenOp
public boolean isSeenOp(Task task,
Operator operator)
addSeenOp
public void addSeenOp(Task task,
Operator operator)
getSeenFileSinkOps
public List<FileSinkOperator> getSeenFileSinkOps()
- Returns:
- file operators already visited
setSeenFileSinkOps
public void setSeenFileSinkOps(List<FileSinkOperator> seenFileSinkOps)
- Parameters:
seenFileSinkOps - file sink operators already visited
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
addRootIfPossible
public boolean addRootIfPossible(Task<? extends Serializable> task)
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
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)
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 © 2014 The Apache Software Foundation. All rights reserved.