public abstract class FixedLengthInputFormat extends FileInputFormat
FileInputFormat.AbstractConfigBuilder<T>, FileInputFormat.ConfigBuilder, FileInputFormat.FileBaseStatistics, FileInputFormat.InputSplitOpenThread| Modifier and Type | Field and Description |
|---|---|
static String |
RECORDLENGTH_PARAMETER_KEY
The config parameter which defines the fixed length of a record.
|
DEFLATE_SUFFIX, enumerateNestedFiles, filePath, minSplitSize, numSplits, openTimeout, READ_WHOLE_SPLIT_FLAG, splitLength, splitStart, stream, unsplittable| Modifier | Constructor and Description |
|---|---|
protected |
FixedLengthInputFormat()
Constructor only sets the key and value classes
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Configuration parameters) |
int |
getReadBufferSize()
Gets the size of the buffer internally used to parse record boundaries.
|
int |
getRecordLength()
Returns the fixed length of a record.
|
FileInputFormat.FileBaseStatistics |
getStatistics(BaseStatistics cachedStats) |
Record |
nextRecord(Record reuse) |
void |
open(FileInputSplit split) |
boolean |
reachedEnd() |
abstract boolean |
readBytes(Record target,
byte[] buffer,
int startPos)
Reads a record out of the given buffer.
|
acceptFile, close, configureFileFormat, createInputSplits, getFilePath, getFileStats, getInputSplitAssigner, getMinSplitSize, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, setFilePath, setFilePath, setMinSplitSize, setNumSplits, setOpenTimeout, testForUnsplittable, toStringpublic static final String RECORDLENGTH_PARAMETER_KEY
protected FixedLengthInputFormat()
public abstract boolean readBytes(Record target, byte[] buffer, int startPos)
target - The target Recordbuffer - The buffer containing the binary data.startPos - The start position in the byte array.public int getRecordLength()
public int getReadBufferSize()
public void configure(Configuration parameters)
configure in interface InputFormat<Record,FileInputSplit>configure in class FileInputFormat<Record>public void open(FileInputSplit split) throws IOException
open in interface InputFormat<Record,FileInputSplit>open in class FileInputFormat<Record>IOExceptionpublic FileInputFormat.FileBaseStatistics getStatistics(BaseStatistics cachedStats) throws IOException
getStatistics in interface InputFormat<Record,FileInputSplit>getStatistics in class FileInputFormat<Record>IOExceptionpublic boolean reachedEnd()
public Record nextRecord(Record reuse) throws IOException
IOExceptionCopyright © 2015 The Apache Software Foundation. All rights reserved.