public abstract class Task<T extends Serializable> extends Object implements Serializable, Node
Modifier and Type | Class and Description |
---|---|
static class |
Task.FeedType |
static class |
Task.TaskState |
Constructor and Description |
---|
Task() |
Modifier and Type | Method and Description |
---|---|
boolean |
addDependentTask(Task<? extends Serializable> dependent)
Add a dependent task on the current task.
|
protected void |
cloneConf() |
boolean |
done() |
boolean |
equals(Object obj) |
protected abstract int |
execute(DriverContext driverContext)
This method is overridden in each Task.
|
int |
executeTask()
This method is called in the Driver on every task.
|
static List<Task<? extends Serializable>> |
findLeafs(List<Task<? extends Serializable>> rootTasks) |
Task<? extends Serializable> |
getAndInitBackupTask() |
List<Task<? extends Serializable>> |
getBackupChildrenTasks() |
Task<? extends Serializable> |
getBackupTask() |
List<? extends Node> |
getChildren()
Gets the vector of children nodes.
|
List<Task<? extends Serializable>> |
getChildTasks() |
HashMap<String,Long> |
getCounters() |
List<Task<? extends Serializable>> |
getDependentTasks()
The default dependent tasks are just child tasks, but different types could implement their own
(e.g.
|
String |
getDiagnosticsMessage() |
DriverContext |
getDriverContext() |
String |
getExternalHandle() |
List<Task<? extends Serializable>> |
getFeedSubscribers() |
protected Hive |
getHive() |
String |
getId() |
boolean |
getInitialized() |
String |
getJobID() |
Collection<MapWork> |
getMapWork() |
int |
getNumChild() |
int |
getNumParent() |
List<Task<? extends Serializable>> |
getParentTasks() |
QueryPlan |
getQueryPlan() |
boolean |
getQueued() |
Operator<? extends OperatorDesc> |
getReducer(MapWork work) |
String |
getStatusMessage() |
TaskHandle |
getTaskHandle() |
Task.TaskState |
getTaskState() |
int |
getTaskTag() |
Collection<Operator<? extends OperatorDesc>> |
getTopOperators() |
abstract StageType |
getType()
Should be overridden to return the type of the specific task among the types in StageType.
|
T |
getWork() |
int |
hashCode() |
boolean |
hasReduce() |
boolean |
ifRetryCmdWhenFail() |
void |
initialize(QueryState queryState,
QueryPlan queryPlan,
DriverContext driverContext,
CompilationOpContext opContext) |
boolean |
isFetchSource() |
boolean |
isLocalMode() |
boolean |
isMapRedLocalTask() |
boolean |
isMapRedTask() |
boolean |
isRootTask() |
boolean |
isRunnable() |
protected void |
pushFeed(Task.FeedType feedType,
Object feedValue) |
protected void |
receiveFeed(Task.FeedType feedType,
Object feedValue) |
void |
removeDependentTask(Task<? extends Serializable> dependent)
Remove the dependent task.
|
void |
removeFromChildrenTasks() |
boolean |
requireLock() |
void |
setBackupChildrenTasks(List<Task<? extends Serializable>> backupChildrenTasks) |
void |
setBackupTask(Task<? extends Serializable> backupTask) |
void |
setChildTasks(List<Task<? extends Serializable>> childTasks) |
void |
setConsole(SessionState.LogHelper console) |
void |
setDiagnosticMessage(String diagnosticMesg) |
void |
setDone() |
void |
setDriverContext(DriverContext driverContext) |
protected void |
setException(Throwable ex) |
void |
setFeedSubscribers(List<Task<? extends Serializable>> s) |
void |
setFetchSource(boolean fetchSource) |
void |
setId(String id) |
void |
setInitialized() |
void |
setLocalMode(boolean isLocalMode) |
void |
setParentTasks(List<Task<? extends Serializable>> parentTasks) |
void |
setQueryDisplay(QueryDisplay queryDisplay) |
void |
setQueryPlan(QueryPlan queryPlan) |
void |
setQueued() |
void |
setRetryCmdWhenFail(boolean retryCmdWhenFail) |
void |
setRootTask(boolean rootTask) |
void |
setStarted() |
protected void |
setState(Task.TaskState state) |
void |
setStatusMessage(String statusMessage) |
void |
setTaskTag(int taskTag) |
void |
setWork(T work) |
void |
shutdown() |
boolean |
started() |
void |
subscribeFeed(Task<? extends Serializable> publisher)
Subscribe the feed of publisher.
|
String |
toString() |
protected void |
updateStatusInQueryDisplay() |
void |
updateTaskMetrics(Metrics metrics)
Provide metrics on the type and number of tasks executed by the HiveServer
|
public transient TaskHandle taskHandle
protected transient HiveConf conf
protected transient QueryState queryState
protected transient SessionState.LogHelper console
protected transient QueryPlan queryPlan
protected transient DriverContext driverContext
protected transient boolean clonedConf
protected transient String jobID
protected Task<? extends Serializable> backupTask
protected List<Task<? extends Serializable>> backupChildrenTasks
protected static transient org.slf4j.Logger LOG
protected int taskTag
public static final int NO_TAG
public static final int COMMON_JOIN
public static final int HINTED_MAPJOIN
public static final int HINTED_MAPJOIN_LOCAL
public static final int CONVERTED_MAPJOIN
public static final int CONVERTED_MAPJOIN_LOCAL
public static final int BACKUP_COMMON_JOIN
public static final int MAPJOIN_ONLY_NOBACKUP
public static final int CONVERTED_SORTMERGEJOIN
public QueryDisplay queryDisplay
protected transient List<Task<? extends Serializable>> feedSubscribers
protected String id
protected T extends Serializable work
protected boolean rootTask
protected List<Task<? extends Serializable>> childTasks
protected List<Task<? extends Serializable>> parentTasks
public void setDiagnosticMessage(String diagnosticMesg)
public String getDiagnosticsMessage()
public void setStatusMessage(String statusMessage)
public String getStatusMessage()
public TaskHandle getTaskHandle()
public void initialize(QueryState queryState, QueryPlan queryPlan, DriverContext driverContext, CompilationOpContext opContext)
public void setQueryDisplay(QueryDisplay queryDisplay)
protected void updateStatusInQueryDisplay()
protected void setState(Task.TaskState state)
protected Hive getHive()
public int executeTask()
protected abstract int execute(DriverContext driverContext)
public boolean isRootTask()
public void setRootTask(boolean rootTask)
public void setChildTasks(List<Task<? extends Serializable>> childTasks)
public List<? extends Node> getChildren()
Node
getChildren
in interface Node
public List<Task<? extends Serializable>> getChildTasks()
public int getNumChild()
public void setParentTasks(List<Task<? extends Serializable>> parentTasks)
public List<Task<? extends Serializable>> getParentTasks()
public int getNumParent()
public Task<? extends Serializable> getBackupTask()
public void setBackupTask(Task<? extends Serializable> backupTask)
public List<Task<? extends Serializable>> getBackupChildrenTasks()
public void setBackupChildrenTasks(List<Task<? extends Serializable>> backupChildrenTasks)
public Task<? extends Serializable> getAndInitBackupTask()
public void removeFromChildrenTasks()
public List<Task<? extends Serializable>> getDependentTasks()
public boolean addDependentTask(Task<? extends Serializable> dependent)
public static List<Task<? extends Serializable>> findLeafs(List<Task<? extends Serializable>> rootTasks)
public void removeDependentTask(Task<? extends Serializable> dependent)
dependent
- the task to removepublic void setStarted()
public boolean started()
public boolean done()
public void setDone()
public void setQueued()
public boolean getQueued()
public void setInitialized()
public boolean getInitialized()
public boolean isRunnable()
public void setWork(T work)
public T getWork()
public Collection<MapWork> getMapWork()
public void setId(String id)
public String getId()
public String getExternalHandle()
public Task.TaskState getTaskState()
public boolean isMapRedTask()
public boolean isMapRedLocalTask()
public Collection<Operator<? extends OperatorDesc>> getTopOperators()
public boolean hasReduce()
public Operator<? extends OperatorDesc> getReducer(MapWork work)
public abstract StageType getType()
public void subscribeFeed(Task<? extends Serializable> publisher)
publisher
- this feed provider.public List<Task<? extends Serializable>> getFeedSubscribers()
public void setFeedSubscribers(List<Task<? extends Serializable>> s)
protected void pushFeed(Task.FeedType feedType, Object feedValue)
protected void receiveFeed(Task.FeedType feedType, Object feedValue)
protected void cloneConf()
public void updateTaskMetrics(Metrics metrics)
metrics
- public int getTaskTag()
public void setTaskTag(int taskTag)
public boolean isLocalMode()
public void setLocalMode(boolean isLocalMode)
public boolean requireLock()
public boolean ifRetryCmdWhenFail()
public void setRetryCmdWhenFail(boolean retryCmdWhenFail)
public QueryPlan getQueryPlan()
public DriverContext getDriverContext()
public void setDriverContext(DriverContext driverContext)
public void setQueryPlan(QueryPlan queryPlan)
public String getJobID()
public void shutdown()
protected void setException(Throwable ex)
public void setConsole(SessionState.LogHelper console)
public boolean isFetchSource()
public void setFetchSource(boolean fetchSource)
Copyright © 2021 The Apache Software Foundation. All rights reserved.