org.apache.hadoop.hive.ql.exec
Class Task<T extends Serializable>

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Task<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConditionalTask, CopyTask, DDLTask, ExecDriver, ExplainTask, FetchTask, FunctionTask, MapRedTask, MoveTask

public abstract class Task<T extends Serializable>
extends Object
implements Serializable

Task implementation

See Also:
Serialized Form

Field Summary
protected  List<Task<? extends Serializable>> childTasks
           
protected  HiveConf conf
           
protected  SessionState.LogHelper console
           
protected  Hive db
           
protected  String id
           
protected  org.apache.commons.logging.Log LOG
           
protected  List<Task<? extends Serializable>> parentTasks
           
protected  T work
           
 
Constructor Summary
Task()
           
 
Method Summary
 boolean addDependentTask(Task<? extends Serializable> dependent)
          Add a dependent task on the current task.
 boolean done()
           
abstract  int execute()
           
 boolean fetch(Vector<String> res)
           
 List<Task<? extends Serializable>> getChildTasks()
           
 String getId()
           
 List<Task<? extends Serializable>> getParentTasks()
           
 T getWork()
           
 boolean hasReduce()
           
 void initialize(HiveConf conf)
           
 boolean isMapRedTask()
           
 boolean isRunnable()
           
 void removeDependentTask(Task<? extends Serializable> dependent)
          remove the dependent task
 void setChildTasks(List<Task<? extends Serializable>> childTasks)
           
 void setDone()
           
 void setId(String id)
           
 void setParentTasks(List<Task<? extends Serializable>> parentTasks)
           
 void setWork(T work)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected transient HiveConf conf

db

protected transient Hive db

LOG

protected transient org.apache.commons.logging.Log LOG

console

protected transient SessionState.LogHelper console

childTasks

protected List<Task<? extends Serializable>> childTasks

parentTasks

protected List<Task<? extends Serializable>> parentTasks

id

protected String id

work

protected T extends Serializable work
Constructor Detail

Task

public Task()
Method Detail

initialize

public void initialize(HiveConf conf)

execute

public abstract int execute()

fetch

public boolean fetch(Vector<String> res)
              throws IOException
Throws:
IOException

setChildTasks

public void setChildTasks(List<Task<? extends Serializable>> childTasks)

getChildTasks

public List<Task<? extends Serializable>> getChildTasks()

setParentTasks

public void setParentTasks(List<Task<? extends Serializable>> parentTasks)

getParentTasks

public List<Task<? extends Serializable>> getParentTasks()

addDependentTask

public boolean addDependentTask(Task<? extends Serializable> dependent)
Add a dependent task on the current task. Return if the dependency already existed or is this a new one

Returns:
true if the task got added false if it already existed

removeDependentTask

public void removeDependentTask(Task<? extends Serializable> dependent)
remove the dependent task

Parameters:
dependent - the task to remove

done

public boolean done()

setDone

public void setDone()

isRunnable

public boolean isRunnable()

setWork

public void setWork(T work)

getWork

public T getWork()

setId

public void setId(String id)

getId

public String getId()

isMapRedTask

public boolean isMapRedTask()

hasReduce

public boolean hasReduce()


Copyright © 2009 The Apache Software Foundation