public class ComposableRecordReader extends BaseRecordReader
inputSplit, listeners, streamCreatorFnAPPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
ComposableRecordReader(RecordReader... readers) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Configuration |
getConf()
Return the configuration used by this object.
|
List<String> |
getLabels()
List of label strings
|
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<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
RecordReader.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
|
boolean |
resetSupported() |
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
batchesSupported, getListeners, invokeListeners, next, setListeners, setListenerspublic ComposableRecordReader(RecordReader... readers)
public void initialize(InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReaderinitialize in class BaseRecordReadersplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
RecordReaderconf - a configuration for initializationsplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic List<Writable> next()
RecordReaderpublic boolean hasNext()
RecordReaderpublic List<String> getLabels()
RecordReaderpublic void close()
throws IOException
IOExceptionpublic void setConf(Configuration conf)
Configurablepublic Configuration getConf()
Configurablepublic void reset()
RecordReaderpublic boolean resetSupported()
public 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 DataInputStreamIOException - 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 loadingCopyright © 2020. All rights reserved.