org.apache.nutch.mapReduce
Class MapOutputFile

java.lang.Object
  extended byorg.apache.nutch.mapReduce.MapOutputFile
All Implemented Interfaces:
Writable

public class MapOutputFile
extends Object
implements Writable

A local file to be transferred via the MapOutputProtocol.


Constructor Summary
MapOutputFile()
          Construct a file for transfer.
MapOutputFile(String mapTaskId, String reduceTaskId, int partition)
           
 
Method Summary
static void cleanupStorage()
          Removes all contents of temporary storage.
static File getInputFile(String mapTaskId, String reduceTaskId)
          Create a local reduce input file name.
static File getOutputFile(String mapTaskId, int partition)
          Create a local map output file name.
 void readFields(DataInput in)
          Reads the fields of this object from in.
static void removeAll(String taskId)
          Removes all of the files related to a task.
 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, toString, wait, wait, wait
 

Constructor Detail

MapOutputFile

public MapOutputFile()
Construct a file for transfer.


MapOutputFile

public MapOutputFile(String mapTaskId,
                     String reduceTaskId,
                     int partition)
Method Detail

getOutputFile

public static File getOutputFile(String mapTaskId,
                                 int partition)
Create a local map output file name.

Parameters:
mapTaskId - a map task id
partition - a reduce partition

getInputFile

public static File getInputFile(String mapTaskId,
                                String reduceTaskId)
Create a local reduce input file name.

Parameters:
mapTaskId - a map task id
reduceTaskId - a reduce task id

removeAll

public static void removeAll(String taskId)
                      throws IOException
Removes all of the files related to a task.

Throws:
IOException

cleanupStorage

public static void cleanupStorage()
                           throws IOException
Removes all contents of temporary storage. Called upon startup, to remove any leftovers from previous run.

Throws:
IOException

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


Copyright © 2006 The Apache Software Foundation