public class FileSplit extends InputSplit implements org.apache.hadoop.io.Writable
InputFormat.getSplits(JobContext) and passed to
InputFormat.createRecordReader(InputSplit,TaskAttemptContext).| Constructor and Description |
|---|
FileSplit(org.apache.hadoop.fs.Path file,
long start,
long length,
java.lang.String[] hosts)
Constructs a split with host information
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLength()
The number of bytes in the file to process.
|
java.lang.String[] |
getLocations()
Get the list of nodes by name where the data for the split would be local.
|
org.apache.hadoop.fs.Path |
getPath()
The file containing this split's data.
|
long |
getStart()
The position of the first byte in the file to process.
|
void |
readFields(java.io.DataInput in) |
java.lang.String |
toString() |
void |
write(java.io.DataOutput out) |
public FileSplit(org.apache.hadoop.fs.Path file,
long start,
long length,
java.lang.String[] hosts)
file - the file namestart - the position of the first byte in the file to processlength - the number of bytes in the file to processhosts - the list of hosts containing the block, possibly nullpublic org.apache.hadoop.fs.Path getPath()
public long getStart()
public long getLength()
getLength in class InputSplitpublic java.lang.String toString()
toString in class java.lang.Objectpublic void write(java.io.DataOutput out)
throws java.io.IOException
write in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic java.lang.String[] getLocations()
throws java.io.IOException
InputSplitgetLocations in class InputSplitjava.io.IOExceptionCopyright © 2009 The Apache Software Foundation