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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Task<ConditionalWork>
      extended by org.apache.hadoop.hive.ql.exec.ConditionalTask
All Implemented Interfaces:
Serializable, Node

public class ConditionalTask
extends Task<ConditionalWork>
implements Serializable

Conditional Task implementation.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.Task
Task.FeedType
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hive.ql.exec.Task
BACKUP_COMMON_JOIN, COMMON_JOIN, CONVERTED_MAPJOIN, CONVERTED_MAPJOIN_LOCAL, CONVERTED_SORTMERGEJOIN, HINTED_MAPJOIN, HINTED_MAPJOIN_LOCAL, MAPJOIN_ONLY_NOBACKUP, NO_TAG, taskCounters, taskHandle
 
Constructor Summary
ConditionalTask()
           
 
Method Summary
 boolean addDependentTask(Task<? extends Serializable> dependent)
          Add a dependent task on the current conditional task.
 boolean done()
           
 int execute(DriverContext driverContext)
          This method is overridden in each Task.
 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>> getListTasks()
           
 String getName()
          Gets the name of the node.
 ConditionalResolver getResolver()
           
 Object getResolverCtx()
           
 org.apache.hadoop.hive.ql.plan.api.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)
           
 boolean isMapRedTask()
           
 void setListTasks(List<Task<? extends Serializable>> listTasks)
           
 void setResolver(ConditionalResolver resolver)
           
 void setResolverCtx(Object resolverCtx)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.Task
equals, executeTask, getAndInitBackupTask, getBackupChildrenTasks, getBackupTask, getChildren, getChildTasks, getCounters, getDriverContext, getFeedSubscribers, getId, getInitialized, getJobID, getParentTasks, getQueryPlan, getQueued, getReducer, getResultSchema, getTaskHandle, getTaskTag, getTopOperators, getWork, hashCode, ifRetryCmdWhenFail, isLocalMode, isMapRedLocalTask, isRootTask, isRunnable, removeDependentTask, removeFromChildrenTasks, requireLock, setBackupChildrenTasks, setBackupTask, setChildTasks, setConsole, setDone, setFeedSubscribers, setId, setInitialized, setLocalMode, setParentTasks, setQueryPlan, setQueued, setRetryCmdWhenFail, setRootTask, setStarted, setTaskTag, setWork, shutdown, started, subscribeFeed, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionalTask

public ConditionalTask()
Method Detail

isMapRedTask

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

hasReduce

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

initialize

public void initialize(HiveConf conf,
                       QueryPlan queryPlan,
                       DriverContext driverContext)
Overrides:
initialize in class Task<ConditionalWork>

execute

public int execute(DriverContext driverContext)
Description copied from class: Task
This method is overridden in each Task. TODO execute should return a TaskHandle.

Returns:
status of executing the task

getResolver

public ConditionalResolver getResolver()
Returns:
the resolver

setResolver

public void setResolver(ConditionalResolver resolver)
Parameters:
resolver - the resolver to set

getResolverCtx

public Object getResolverCtx()
Returns:
the resolverCtx

done

public boolean done()
Overrides:
done in class Task<ConditionalWork>

setResolverCtx

public void setResolverCtx(Object resolverCtx)
Parameters:
resolverCtx - the resolverCtx to set

getListTasks

public List<Task<? extends Serializable>> getListTasks()
Returns:
the listTasks

setListTasks

public void setListTasks(List<Task<? extends Serializable>> listTasks)
Parameters:
listTasks - the listTasks to set

getType

public org.apache.hadoop.hive.ql.plan.api.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<ConditionalWork>
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

addDependentTask

public boolean addDependentTask(Task<? extends Serializable> dependent)
Add a dependent task on the current conditional task. The task will not be a direct child of conditional task. Actually it will be added as child task of associated tasks.

Overrides:
addDependentTask in class Task<ConditionalWork>
Returns:
true if the task got added false if it already existed

getDependentTasks

public List<Task<? extends Serializable>> getDependentTasks()
Description copied from class: Task
The default dependent tasks are just child tasks, but different types could implement their own (e.g. ConditionalTask will use the listTasks as dependents).

Overrides:
getDependentTasks in class Task<ConditionalWork>
Returns:
a list of tasks that are dependent on this task.


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