org.apache.hadoop.hive.ql.exec
Class ExecDriver

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Task<MapredWork>
      extended by org.apache.hadoop.hive.ql.exec.ExecDriver
All Implemented Interfaces:
Serializable, Node
Direct Known Subclasses:
MapRedTask

public class ExecDriver
extends Task<MapredWork>
implements Serializable

ExecDriver.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.Task
Task.FeedType
 
Field Summary
protected  org.apache.hadoop.mapred.JobConf job
           
 String jobId
           
protected  int mapProgress
           
static MemoryMXBean memoryMXBean
           
protected  int reduceProgress
           
 
Fields inherited from class org.apache.hadoop.hive.ql.exec.Task
BACKUP_COMMON_JOIN, backupChildrenTasks, backupTask, childTasks, clonedConf, COMMON_JOIN, conf, console, CONVERTED_LOCAL_MAPJOIN, CONVERTED_MAPJOIN, db, driverContext, feedSubscribers, id, initialized, isdone, LOCAL_MAPJOIN, LOG, NO_TAG, parentTasks, queryPlan, queued, started, taskCounters, taskHandle, taskTag, work
 
Constructor Summary
ExecDriver()
          Constructor when invoked from QL.
ExecDriver(MapredWork plan, org.apache.hadoop.mapred.JobConf job, boolean isSilent)
          Constructor/Initialization for invocation as independent utility.
 
Method Summary
 int execute(DriverContext driverContext)
          Execute a query plan using Hadoop.
static String generateCmdLine(HiveConf hconf)
          Given a Hive Configuration object - generate a command line fragment for passing such configuration information to ExecDriver.
static String getJobEndMsg(String jobId)
          this msg pattern is used to track when a job is successfully done.
 String getJobId()
           
 String getName()
          Gets the name of the node.
protected static String getResourceFiles(org.apache.hadoop.conf.Configuration conf, SessionState.ResourceType t)
           
 StageType getType()
          Should be overridden to return the type of the specific task among the types in StageType.
 boolean hasReduce()
           
 void initialize(HiveConf conf, QueryPlan queryPlan, DriverContext driverContext)
          Initialization when invoked from QL.
 boolean isMapRedTask()
           
protected  void localizeMRTmpFilesImpl(Context ctx)
          If this task uses any map-reduce intermediate data (either for reading or for writing), localize them (using the supplied Context).
static void main(String[] args)
           
 boolean mapDone()
           
 boolean mapStarted()
           
 boolean reduceDone()
           
 boolean reduceStarted()
           
 void setJobId(String jobId)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.Task
addDependentTask, cloneConf, done, executeTask, fetch, getAndInitBackupTask, getBackupChildrenTasks, getBackupTask, getChildren, getChildTasks, getCounters, getDependentTasks, getFeedSubscribers, getId, getInitialized, getParentTasks, getQueued, getTaskTag, getWork, isLocalMode, isMapRedLocalTask, isRunnable, localizeMRTmpFiles, pushFeed, receiveFeed, removeDependentTask, removeFromChildrenTasks, setBackupChildrenTasks, setBackupTask, setChildTasks, setDone, setFeedSubscribers, setId, setInitialized, setLocalMode, setParentTasks, setQueued, setStarted, setTaskTag, setWork, started, subscribeFeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

job

protected transient org.apache.hadoop.mapred.JobConf job

mapProgress

protected transient int mapProgress

reduceProgress

protected transient int reduceProgress

jobId

public transient String jobId

memoryMXBean

public static MemoryMXBean memoryMXBean
Constructor Detail

ExecDriver

public ExecDriver()
Constructor when invoked from QL.


ExecDriver

public ExecDriver(MapredWork plan,
                  org.apache.hadoop.mapred.JobConf job,
                  boolean isSilent)
           throws HiveException
Constructor/Initialization for invocation as independent utility.

Throws:
HiveException
Method Detail

getJobId

public String getJobId()

setJobId

public void setJobId(String jobId)

getResourceFiles

protected static String getResourceFiles(org.apache.hadoop.conf.Configuration conf,
                                         SessionState.ResourceType t)

initialize

public void initialize(HiveConf conf,
                       QueryPlan queryPlan,
                       DriverContext driverContext)
Initialization when invoked from QL.

Overrides:
initialize in class Task<MapredWork>

mapStarted

public boolean mapStarted()

reduceStarted

public boolean reduceStarted()

mapDone

public boolean mapDone()

reduceDone

public boolean reduceDone()

execute

public int execute(DriverContext driverContext)
Execute a query plan using Hadoop.

Specified by:
execute in class Task<MapredWork>
Returns:
status of executing the task

getJobEndMsg

public static String getJobEndMsg(String jobId)
this msg pattern is used to track when a job is successfully done.

Parameters:
jobId -
Returns:

main

public static void main(String[] args)
                 throws IOException,
                        HiveException
Throws:
IOException
HiveException

generateCmdLine

public static String generateCmdLine(HiveConf hconf)
Given a Hive Configuration object - generate a command line fragment for passing such configuration information to ExecDriver.


isMapRedTask

public boolean isMapRedTask()
Overrides:
isMapRedTask in class Task<MapredWork>

hasReduce

public boolean hasReduce()
Overrides:
hasReduce in class Task<MapredWork>

getType

public StageType getType()
Description copied from class: Task
Should be overridden to return the type of the specific task among the types in StageType.

Specified by:
getType in class Task<MapredWork>
Returns:
StageType.* or null if not overridden

getName

public String getName()
Description copied from interface: Node
Gets the name of the node. This is used in the rule dispatchers.

Specified by:
getName in interface Node
Returns:
String

localizeMRTmpFilesImpl

protected void localizeMRTmpFilesImpl(Context ctx)
Description copied from class: Task
If this task uses any map-reduce intermediate data (either for reading or for writing), localize them (using the supplied Context). Map-Reduce intermediate directories are allocated using Context.getMRTmpFileURI() and can be localized using localizeMRTmpFileURI(). This method is declared abstract to force any task code to explicitly deal with this aspect of execution.

Specified by:
localizeMRTmpFilesImpl in class Task<MapredWork>
Parameters:
ctx - context object with which to localize


Copyright © 2011 The Apache Software Foundation