| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.InputSplit
org.apache.hadoop.mapreduce.lib.input.FileSplit
@InterfaceAudience.Public @InterfaceStability.Stable public class FileSplit
A section of an input file.  Returned by InputFormat.getSplits(JobContext) and passed to
 InputFormat.createRecordReader(InputSplit,TaskAttemptContext).
| Constructor Summary | |
|---|---|
| FileSplit() | |
| FileSplit(Path file,
                   long start,
                   long length,
                   String[] hosts)Constructs a split with host information | |
| FileSplit(Path file,
                   long start,
                   long length,
                   String[] hosts,
                   String[] inMemoryHosts)Constructs a split with host and cached-blocks information | |
| Method Summary | |
|---|---|
|  long | getLength()The number of bytes in the file to process. | 
|  SplitLocationInfo[] | getLocationInfo()Gets info about which nodes the input split is stored on and how it is stored at each location. | 
|  String[] | getLocations()Get the list of nodes by name where the data for the split would be local. | 
|  Path | getPath()The file containing this split's data. | 
|  long | getStart()The position of the first byte in the file to process. | 
|  void | readFields(DataInput in)Deserialize the fields of this object from in. | 
|  String | toString() | 
|  void | write(DataOutput out)Serialize 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 | 
|---|
public FileSplit()
public FileSplit(Path file,
                 long start,
                 long length,
                 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 null
public FileSplit(Path file,
                 long start,
                 long length,
                 String[] hosts,
                 String[] inMemoryHosts)
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 blockinMemoryHosts - the list of hosts containing the block in memory| Method Detail | 
|---|
public Path getPath()
public long getStart()
public long getLength()
getLength in class InputSplitpublic String toString()
toString in class Object
public void write(DataOutput out)
           throws IOException
Writableout.
write in interface Writableout - DataOuput to serialize this object into.
IOException
public void readFields(DataInput in)
                throws IOException
Writablein.  
 
 For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.
IOException
public String[] getLocations()
                      throws IOException
InputSplit
getLocations in class InputSplitIOException
@InterfaceStability.Evolving
public SplitLocationInfo[] getLocationInfo()
                                    throws IOException
InputSplit
getLocationInfo in class InputSplitSplitLocationInfos describing how the split
    data is stored at each location. A null value indicates that all the
    locations have the data stored on disk.
IOException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||