org.apache.nutch.mapReduce
Class Task

java.lang.Object
  extended byorg.apache.nutch.mapReduce.Task
All Implemented Interfaces:
Writable
Direct Known Subclasses:
MapTask, ReduceTask

public abstract class Task
extends Object
implements Writable

Base class for tasks.


Constructor Summary
Task()
           
Task(String jobFile, String taskId)
           
 
Method Summary
abstract  org.apache.nutch.mapReduce.TaskRunner createRunner(TaskTracker tracker)
          Return an approprate thread runner for this task.
 String getJobFile()
           
 String getTaskId()
           
 void readFields(DataInput in)
          Reads the fields of this object from in.
abstract  void run(JobConf job, TaskUmbilicalProtocol umbilical)
          Run this task as a part of the named job.
 void setJobFile(String jobFile)
           
 String toString()
           
 void write(DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Task

public Task()

Task

public Task(String jobFile,
            String taskId)
Method Detail

setJobFile

public void setJobFile(String jobFile)

getJobFile

public String getJobFile()

getTaskId

public String getTaskId()

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Writes the fields of this object to out.

Specified by:
write in interface Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Throws:
IOException

toString

public String toString()

run

public abstract void run(JobConf job,
                         TaskUmbilicalProtocol umbilical)
                  throws IOException
Run this task as a part of the named job. This method is executed in the child process and is what invokes user-supplied map, reduce, etc. methods.

Parameters:
umbilical - for progress reports
Throws:
IOException

createRunner

public abstract org.apache.nutch.mapReduce.TaskRunner createRunner(TaskTracker tracker)
Return an approprate thread runner for this task.



Copyright © 2006 The Apache Software Foundation