public class TextInputSplit extends DelimitedInputSplit<java.lang.String>
FileInputSplit.InputSplitOpenThread
RECORD_DELIMITER
enumerateNestedFiles, MAX_SPLIT_SIZE_DISCREPANCY, minSplitSize, numSplits, openTimeout, splitLength, splitStart, stream
Constructor and Description |
---|
TextInputSplit(int num,
Path file,
long start,
long length,
java.lang.String[] hosts)
Constructs a split with host information.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(Config parameters)
Configures this input format by reading the path to the file from the
configuration and the string that
defines the record delimiter.
|
java.lang.String |
getCharsetName() |
java.lang.String |
readRecord(java.lang.String reusable,
byte[] bytes,
int readOffset,
int numBytes)
This function parses the given byte array which represents a serialized record.
|
void |
setCharsetName(java.lang.String charsetName) |
close, getBufferSize, getCharset, getDelimiter, getDelimiterString, getLineLengthLimit, nextRecord, open, reachedEnd, readLine, setBufferSize, setDelimiter, setDelimiterString, setLineLengthLimit
equals, getLength, getMinSplitSize, getNumSplits, getPath, getStart, hashCode, isEnumerateNestedFiles, open, setEnumerateNestedFiles, setMinSplitSize, setNumSplits, toString
getHostnames, getSplitNumber
public TextInputSplit(int num, Path file, long start, long length, java.lang.String[] hosts)
num
- the number of this input splitfile
- the file namestart
- the position of the first byte in the file to processlength
- the number of bytes in the file to process (-1 is flag for "read whole file")hosts
- the list of hosts containing the block, possibly null
public java.lang.String getCharsetName()
getCharsetName
in class DelimitedInputSplit<java.lang.String>
public void setCharsetName(java.lang.String charsetName)
setCharsetName
in class DelimitedInputSplit<java.lang.String>
public void configure(Config parameters)
DelimitedInputSplit
configure
in interface InputSplit<java.lang.String>
configure
in class DelimitedInputSplit<java.lang.String>
parameters
- The configuration object to read the parameters from.public java.lang.String readRecord(java.lang.String reusable, byte[] bytes, int readOffset, int numBytes) throws java.io.IOException
DelimitedInputSplit
readRecord
in class DelimitedInputSplit<java.lang.String>
reusable
- An optionally reusable object.bytes
- Binary data of serialized records.readOffset
- The offset where to start to read the record data.numBytes
- The number of bytes that can be read starting at the offset position.java.io.IOException
- if the record could not be read.