public class FileSplit extends InputSplit implements InputSplit
InputFormat.getSplits(JobConf, int)
and passed to
InputFormat.getRecordReader(InputSplit,JobConf,Reporter)
.构造器和说明 |
---|
FileSplit(Path file,
long start,
long length,
JobConf conf)
已过时。
|
FileSplit(Path file,
long start,
long length,
String[] hosts)
Constructs a split with host information
|
限定符和类型 | 方法和说明 |
---|---|
long |
getLength()
The number of bytes in the file to process.
|
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 . |
@Deprecated public FileSplit(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(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 Path getPath()
public long getStart()
public long getLength()
getLength
在接口中 InputSplit
getLength
在类中 InputSplit
public void write(DataOutput out) throws IOException
Writable
out
.write
在接口中 Writable
out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
在接口中 Writable
in
- DataInput
to deseriablize this object from.IOException
public String[] getLocations() throws IOException
InputSplit
getLocations
在接口中 InputSplit
getLocations
在类中 InputSplit
IOException
Copyright © 2009 The Apache Software Foundation