org.apache.hama.bsp
Class Task
java.lang.Object
org.apache.hama.bsp.Task
- All Implemented Interfaces:
- org.apache.hadoop.io.Writable
- Direct Known Subclasses:
- BSPTask
public abstract class Task
- extends Object
- implements org.apache.hadoop.io.Writable
Base class for tasks.
LOG
public static final org.apache.commons.logging.Log LOG
jobId
protected BSPJobID jobId
jobFile
protected String jobFile
taskId
protected TaskAttemptID taskId
partition
protected int partition
lDirAlloc
protected org.apache.hadoop.fs.LocalDirAllocator lDirAlloc
Task
public Task()
Task
public Task(BSPJobID jobId,
String jobFile,
TaskAttemptID taskId,
int partition)
setJobFile
public void setJobFile(String jobFile)
getJobFile
public String getJobFile()
getTaskAttemptId
public TaskAttemptID getTaskAttemptId()
getTaskID
public TaskAttemptID getTaskID()
getJobID
public BSPJobID getJobID()
- Get the job name for this task.
- Returns:
- the job name
getPartition
public int getPartition()
- Get the index of this task within the job.
- Returns:
- the integer part of the task id
toString
public String toString()
- Overrides:
toString
in class Object
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
run
public abstract void run(BSPJob job,
BSPPeerProtocol umbilical)
throws IOException
- Run this task as a part of the named job. This method is executed in the
child process.
- Parameters:
umbilical
- for progress reports
- Throws:
IOException
createRunner
public abstract BSPTaskRunner createRunner(GroomServer groom)
done
public void done(BSPPeerProtocol umbilical)
throws IOException
- Throws:
IOException
getConf
public abstract BSPJob getConf()
setConf
public abstract void setConf(BSPJob localJobConf)
Copyright © 2011 The Apache Software Foundation