public class FileRecordReader extends Object implements RecordReader
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
appendLabel |
protected Configuration |
conf |
protected File |
currentFile |
protected Iterator<File> |
iter |
protected List<String> |
labels |
APPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
FileRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
doInitialize(InputSplit split) |
Configuration |
getConf()
Return the configuration used by this object.
|
protected int |
getCurrentLabel()
Return the current label.
|
List<String> |
getLabels() |
boolean |
hasNext()
Whether there are anymore records
|
void |
initialize(Configuration conf,
InputSplit split)
Called once at initialization.
|
void |
initialize(InputSplit split)
Called once at initialization.
|
Collection<Writable> |
next()
Get the next record
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
void |
setLabels(List<String> labels) |
protected Configuration conf
protected File currentFile
protected boolean appendLabel
public void initialize(InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReadersplit - the split that defines the range of records to readIOExceptionInterruptedExceptionprotected void doInitialize(InputSplit split)
public void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReaderconf - a configuration for initializationsplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic Collection<Writable> next()
RecordReadernext in interface RecordReaderprotected int getCurrentLabel()
public boolean hasNext()
RecordReaderhasNext in interface RecordReaderpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void setConf(Configuration conf)
ConfigurablesetConf in interface Configurablepublic Configuration getConf()
ConfigurablegetConf in interface ConfigurableCopyright © 2015. All rights reserved.