org.apache.nutch.mapReduce
Class FileSplit

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

public class FileSplit
extends Object
implements Writable

A section of an input file. Returned by InputFormat.getSplits(NutchFileSystem, JobConf, int) and passed to InputFormat.getRecordReader(NutchFileSystem, FileSplit, JobConf).


Constructor Summary
FileSplit(File file, long start, long length)
          Constructs a split.
 
Method Summary
 File getFile()
          The file containing this split's data.
 long getLength()
          The number of bytes in the file to process.
 long getStart()
          The position of the first byte in the file to process.
 void readFields(DataInput in)
          Reads the fields of this object from in.
 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

FileSplit

public FileSplit(File file,
                 long start,
                 long length)
Constructs a split.

Parameters:
file - the file name
start - the position of the first byte in the file to process
length - the number of bytes in the file to process
Method Detail

getFile

public File getFile()
The file containing this split's data.


getStart

public long getStart()
The position of the first byte in the file to process.


getLength

public long getLength()
The number of bytes in the file to process.


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