org.apache.hama.bsp
Class Task

java.lang.Object
  extended by org.apache.hama.bsp.Task
All Implemented Interfaces:
org.apache.hadoop.io.Writable
Direct Known Subclasses:
BSPTask

public abstract class Task
extends java.lang.Object
implements org.apache.hadoop.io.Writable

Base class for tasks.


Field Summary
protected  java.lang.String jobFile
           
protected  BSPJobID jobId
           
protected  org.apache.hadoop.fs.LocalDirAllocator lDirAlloc
           
static org.apache.commons.logging.Log LOG
           
protected  int partition
           
protected  TaskAttemptID taskId
           
 
Constructor Summary
Task()
           
Task(BSPJobID jobId, java.lang.String jobFile, TaskAttemptID taskId, int partition)
           
 
Method Summary
abstract  BSPTaskRunner createRunner(GroomServer groom)
           
 void done(BSPPeerProtocol umbilical)
           
abstract  BSPJob getConf()
           
 java.lang.String getJobFile()
           
 BSPJobID getJobID()
          Get the job name for this task.
 int getPartition()
          Get the index of this task within the job.
 TaskAttemptID getTaskAttemptId()
           
 TaskAttemptID getTaskID()
           
 void readFields(java.io.DataInput in)
           
abstract  void run(BSPJob job, BSPPeerProtocol umbilical)
          Run this task as a part of the named job.
abstract  void setConf(BSPJob localJobConf)
           
 void setJobFile(java.lang.String jobFile)
           
 java.lang.String toString()
           
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

jobId

protected BSPJobID jobId

jobFile

protected java.lang.String jobFile

taskId

protected TaskAttemptID taskId

partition

protected int partition

lDirAlloc

protected org.apache.hadoop.fs.LocalDirAllocator lDirAlloc
Constructor Detail

Task

public Task()

Task

public Task(BSPJobID jobId,
            java.lang.String jobFile,
            TaskAttemptID taskId,
            int partition)
Method Detail

setJobFile

public void setJobFile(java.lang.String jobFile)

getJobFile

public java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

run

public abstract void run(BSPJob job,
                         BSPPeerProtocol umbilical)
                  throws java.io.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:
java.io.IOException

createRunner

public abstract BSPTaskRunner createRunner(GroomServer groom)

done

public void done(BSPPeerProtocol umbilical)
          throws java.io.IOException
Throws:
java.io.IOException

getConf

public abstract BSPJob getConf()

setConf

public abstract void setConf(BSPJob localJobConf)


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.