org.apache.hadoop.hive.ql.plan
Class ReduceWork

java.lang.Object
  extended by org.apache.hadoop.hive.ql.plan.AbstractOperatorDesc
      extended by org.apache.hadoop.hive.ql.plan.BaseWork
          extended by org.apache.hadoop.hive.ql.plan.ReduceWork
All Implemented Interfaces:
Serializable, Cloneable, OperatorDesc

public class ReduceWork
extends BaseWork

ReduceWork represents all the information used to run a reduce task on the cluster. It is first used when the query planner breaks the logical plan into tasks and used throughout physical optimization to track reduce-side operator plans, schema info about key/value pairs, etc ExecDriver will serialize the contents of this class and make sure it is distributed on the cluster. The ExecReducer will ultimately deserialize this class on the data nodes and setup it's operator pipeline accordingly. This class is also used in the explain command any property with the appropriate annotation will be displayed in the explain output.

See Also:
Serialized Form

Constructor Summary
ReduceWork()
           
ReduceWork(String name)
           
 
Method Summary
 void configureJobConf(org.apache.hadoop.mapred.JobConf job)
           
 Set<Operator<?>> getAllRootOperators()
           
 TableDesc getKeyDesc()
           
 boolean getNeedsTagging()
           
 Integer getNumReduceTasks()
          If the number of reducers is -1, the runtime will automatically figure it out by input data size.
 Operator<?> getReducer()
           
 Map<Integer,String> getTagToInput()
           
 List<TableDesc> getTagToValueDesc()
           
 String getVectorModeOn()
           
 void replaceRoots(Map<Operator<?>,Operator<?>> replacementMap)
           
 void setKeyDesc(TableDesc keyDesc)
          If the plan has a reducer and correspondingly a reduce-sink, then store the TableDesc pointing to keySerializeInfo of the ReduceSink
 void setNeedsTagging(boolean needsTagging)
           
 void setNumReduceTasks(Integer numReduceTasks)
           
 void setReducer(Operator<?> reducer)
           
 void setTagToInput(Map<Integer,String> tagToInput)
           
 void setTagToValueDesc(List<TableDesc> tagToValueDesc)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.plan.BaseWork
addDummyOp, getAllOperators, getDummyOps, getName, isGatheringStats, setDummyOps, setGatheringStats, setName
 
Methods inherited from class org.apache.hadoop.hive.ql.plan.AbstractOperatorDesc
clone, getOpTraits, getStatistics, setOpTraits, setStatistics, setVectorMode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReduceWork

public ReduceWork()

ReduceWork

public ReduceWork(String name)
Method Detail

setKeyDesc

public void setKeyDesc(TableDesc keyDesc)
If the plan has a reducer and correspondingly a reduce-sink, then store the TableDesc pointing to keySerializeInfo of the ReduceSink

Parameters:
keyDesc -

getKeyDesc

public TableDesc getKeyDesc()

getTagToValueDesc

public List<TableDesc> getTagToValueDesc()

setTagToValueDesc

public void setTagToValueDesc(List<TableDesc> tagToValueDesc)

getVectorModeOn

public String getVectorModeOn()

getReducer

public Operator<?> getReducer()

setReducer

public void setReducer(Operator<?> reducer)

getNeedsTagging

public boolean getNeedsTagging()

setNeedsTagging

public void setNeedsTagging(boolean needsTagging)

setTagToInput

public void setTagToInput(Map<Integer,String> tagToInput)

getTagToInput

public Map<Integer,String> getTagToInput()

replaceRoots

public void replaceRoots(Map<Operator<?>,Operator<?>> replacementMap)
Specified by:
replaceRoots in class BaseWork

getAllRootOperators

public Set<Operator<?>> getAllRootOperators()
Specified by:
getAllRootOperators in class BaseWork

getNumReduceTasks

public Integer getNumReduceTasks()
If the number of reducers is -1, the runtime will automatically figure it out by input data size. The number of reducers will be a positive number only in case the target table is bucketed into N buckets (through CREATE TABLE). This feature is not supported yet, so the number of reducers will always be -1 for now.


setNumReduceTasks

public void setNumReduceTasks(Integer numReduceTasks)

configureJobConf

public void configureJobConf(org.apache.hadoop.mapred.JobConf job)
Specified by:
configureJobConf in class BaseWork


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