public abstract class Task<T extends Serializable> extends Object implements Serializable, Node
Modifier and Type | Class and Description |
---|---|
static class |
Task.FeedType |
Modifier and Type | Field and Description |
---|---|
static int |
BACKUP_COMMON_JOIN |
protected List<Task<? extends Serializable>> |
backupChildrenTasks |
protected Task<? extends Serializable> |
backupTask |
protected List<Task<? extends Serializable>> |
childTasks |
protected boolean |
clonedConf |
static int |
COMMON_JOIN |
protected HiveConf |
conf |
protected SessionState.LogHelper |
console |
static int |
CONVERTED_MAPJOIN |
static int |
CONVERTED_MAPJOIN_LOCAL |
static int |
CONVERTED_SORTMERGEJOIN |
protected Hive |
db |
protected DriverContext |
driverContext |
protected List<Task<? extends Serializable>> |
feedSubscribers |
static int |
HINTED_MAPJOIN |
static int |
HINTED_MAPJOIN_LOCAL |
protected String |
id |
protected boolean |
initialized |
protected boolean |
isdone |
protected String |
jobID |
protected static org.apache.commons.logging.Log |
LOG |
static int |
MAPJOIN_ONLY_NOBACKUP |
static int |
NO_TAG |
protected List<Task<? extends Serializable>> |
parentTasks |
protected QueryPlan |
queryPlan |
protected boolean |
queued |
protected boolean |
rootTask |
protected boolean |
started |
HashMap<String,Long> |
taskCounters |
TaskHandle |
taskHandle |
protected int |
taskTag |
protected T |
work |
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.
|
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.
|
List<Task<? extends Serializable>> |
getFeedSubscribers() |
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) |
TaskHandle |
getTaskHandle() |
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(HiveConf conf,
QueryPlan queryPlan,
DriverContext driverContext) |
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 |
setDone() |
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 |
setQueryPlan(QueryPlan queryPlan) |
void |
setQueued() |
void |
setRetryCmdWhenFail(boolean retryCmdWhenFail) |
void |
setRootTask(boolean rootTask) |
void |
setStarted() |
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() |
public transient TaskHandle taskHandle
protected transient boolean started
protected transient boolean initialized
protected transient boolean isdone
protected transient boolean queued
protected transient HiveConf conf
protected transient Hive db
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.apache.commons.logging.Log 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
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 TaskHandle getTaskHandle()
public void initialize(HiveConf conf, QueryPlan queryPlan, DriverContext driverContext)
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 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 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 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 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 © 2017 The Apache Software Foundation. All rights reserved.