public class ListStringRecordReader extends BaseRecordReader
listenersAPPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
ListStringRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream and releases any system resources associated
with it.
|
Configuration |
getConf()
Return the configuration used by this object.
|
List<String> |
getLabels()
List of label strings
|
boolean |
hasNext()
Check whether there are anymore records
|
void |
initialize(Configuration conf,
InputSplit split)
Called once at initialization.
|
void |
initialize(InputSplit split)
Called once at initialization.
|
List<Record> |
loadFromMetaData(List<RecordMetaData> recordMetaDatas)
Load multiple records from the given a list of
RecordMetaData instances |
Record |
loadFromMetaData(RecordMetaData recordMetaData)
Load a single record from the given
RecordMetaData instanceNote: that for data that isn't splittable (i.e., text data that needs to be scanned/split), it is more efficient to load multiple records at once using RecordReader.loadFromMetaData(List) |
List<Writable> |
next()
Get the next record
|
Record |
nextRecord()
Similar to
RecordReader.next(), but returns a Record object, that may include metadata such as the source
of the data |
List<Writable> |
record(URI uri,
DataInputStream dataInputStream)
Load the record from the given DataInputStream
Unlike
next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStream |
void |
reset()
Reset record reader iterator
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
batchesSupported, getListeners, invokeListeners, next, setListeners, setListenerspublic void initialize(InputSplit split) throws IOException, InterruptedException
split - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
conf - a configuration for initializationsplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic boolean hasNext()
public void reset()
public List<Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamuri - dataInputStream - IOException - if error occurs during reading from the input streampublic Record nextRecord()
RecordReaderRecordReader.next(), but returns a Record object, that may include metadata such as the source
of the datapublic Record loadFromMetaData(RecordMetaData recordMetaData) throws IOException
RecordReaderRecordMetaData instanceRecordReader.loadFromMetaData(List)recordMetaData - Metadata for the record that we want to load fromIOException - If I/O error occurs during loadingpublic List<Record> loadFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException
RecordReaderRecordMetaData instancesrecordMetaDatas - Metadata for the records that we want to load fromIOException - If I/O error occurs during loadingpublic void close()
throws IOException
As noted in AutoCloseable.close(), cases where the
close may fail require careful attention. It is strongly advised
to relinquish the underlying resources and to internally
mark the Closeable as closed, prior to throwing
the IOException.
IOException - if an I/O error occurspublic void setConf(Configuration conf)
conf - public Configuration getConf()
Copyright © 2017. All rights reserved.