public class LibSvmRecordReader extends LineRecordReader
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASSIFICATION |
static String |
NAME_SPACE |
static String |
NUM_FEATURES |
conf, inputSplit, lineIndex, locations, splitIndexlistenersAPPEND_LABEL, LABELS| Constructor and Description |
|---|
LibSvmRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Configuration |
getConf()
Return the configuration used by this object.
|
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.
|
List<Writable> |
next()
Get the next record
|
List<Writable> |
record(URI uri,
DataInputStream dataInputStream)
Load the record from the given DataInputStream
Unlike
RecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStream |
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
closeIfRequired, getIterator, getLabels, loadFromMetaData, loadFromMetaData, nextRecord, onLocationOpen, resetgetListeners, invokeListeners, setListeners, setListenerspublic static final String CLASSIFICATION
public static final String NAME_SPACE
public static final String NUM_FEATURES
public void initialize(InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReaderinitialize in class LineRecordReadersplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReaderinitialize in class LineRecordReaderconf - a configuration for initializationsplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic List<Writable> next()
RecordReadernext in interface RecordReadernext in class LineRecordReaderpublic boolean hasNext()
RecordReaderhasNext in interface RecordReaderhasNext in class LineRecordReaderpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class LineRecordReaderIOExceptionpublic void setConf(Configuration conf)
ConfigurablesetConf in interface ConfigurablesetConf in class LineRecordReaderpublic Configuration getConf()
ConfigurablegetConf in interface ConfigurablegetConf in class LineRecordReaderpublic List<Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
RecordReaderRecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamrecord in interface RecordReaderrecord in class LineRecordReaderIOException - if error occurs during reading from the input streamCopyright © 2017. All rights reserved.