public abstract class BaseRecordReader extends Object implements RecordReader
| Modifier and Type | Field and Description |
|---|---|
protected InputSplit |
inputSplit |
protected List<RecordListener> |
listeners |
protected Function<URI,InputStream> |
streamCreatorFn |
APPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
BaseRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
batchesSupported()
This method returns true, if next(int) signature is supported by this RecordReader implementation.
|
List<RecordListener> |
getListeners()
Get the record listeners for this record reader.
|
void |
initialize(InputSplit split)
Called once at initialization.
|
protected void |
invokeListeners(Object record)
Invokes
RecordListener.recordRead(RecordReader, Object) on all listeners. |
List<List<Writable>> |
next(int num)
This method will be used, if batchesSupported() returns true.
|
void |
setListeners(Collection<RecordListener> listeners)
Set the record listeners for this record reader.
|
void |
setListeners(RecordListener... listeners)
Set the record listeners for this record reader.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLabels, hasNext, initialize, loadFromMetaData, loadFromMetaData, next, nextRecord, record, reset, resetSupportedgetConf, setConfprotected InputSplit inputSplit
protected List<RecordListener> listeners
protected Function<URI,InputStream> streamCreatorFn
protected void invokeListeners(Object record)
RecordListener.recordRead(RecordReader, Object) on all listeners.public void initialize(InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReadersplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic List<RecordListener> getListeners()
RecordReadergetListeners in interface RecordReaderpublic void setListeners(Collection<RecordListener> listeners)
RecordReadersetListeners in interface RecordReaderpublic void setListeners(RecordListener... listeners)
RecordReadersetListeners in interface RecordReaderpublic boolean batchesSupported()
RecordReaderbatchesSupported in interface RecordReaderpublic List<List<Writable>> next(int num)
RecordReadernext in interface RecordReaderCopyright © 2020. All rights reserved.