@InterfaceAudience.Public @InterfaceStability.Stable public class FileSplit extends InputSplit implements InputSplitWithLocationInfo
InputFormat.getSplits(JobConf, int) and passed to
InputFormat.getRecordReader(InputSplit,JobConf,Reporter).| Modifier | Constructor and Description |
|---|---|
protected |
FileSplit() |
|
FileSplit(FileSplit fs) |
|
FileSplit(org.apache.hadoop.fs.Path file,
long start,
long length,
JobConf conf)
Deprecated.
|
|
FileSplit(org.apache.hadoop.fs.Path file,
long start,
long length,
String[] hosts)
Constructs a split with host information
|
|
FileSplit(org.apache.hadoop.fs.Path file,
long start,
long length,
String[] hosts,
String[] inMemoryHosts)
Constructs a split with host information
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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(DataInput in) |
String |
toString() |
void |
write(DataOutput out) |
protected FileSplit()
@Deprecated public FileSplit(org.apache.hadoop.fs.Path file, long start, long length, JobConf conf)
file - the file namestart - the position of the first byte in the file to processlength - the number of bytes in the file to processpublic FileSplit(org.apache.hadoop.fs.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 nullpublic FileSplit(org.apache.hadoop.fs.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 block, possibly nullinMemoryHosts - the list of hosts containing the block in memorypublic FileSplit(FileSplit fs)
public org.apache.hadoop.fs.Path getPath()
public long getStart()
public long getLength()
getLength in interface InputSplitgetLength in class InputSplitpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic String[] getLocations() throws IOException
InputSplitgetLocations in interface InputSplitgetLocations in class InputSplitIOException@InterfaceStability.Evolving public SplitLocationInfo[] getLocationInfo() throws IOException
InputSplitgetLocationInfo in interface InputSplitWithLocationInfogetLocationInfo 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.IOExceptionCopyright © 2008–2019 Apache Software Foundation. All rights reserved.