public class IterableRecordReader extends Object implements RecordReader
Iterable data source.
This reader produces GenericRecord instances containing original objects from the datasource.| Constructor and Description |
|---|
IterableRecordReader(Iterable dataSource)
Reads record from an
Iterable data source. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader.
|
String |
getDataSourceName()
This method returns a human readable data source name to be shown in the batch report.
|
Long |
getTotalRecords()
Get the total record number in the data source.
|
boolean |
hasNextRecord()
Check if the reader has a next record.
|
void |
open()
Open the reader.
|
GenericRecord |
readNextRecord()
Read next record from the data source.
|
public IterableRecordReader(Iterable dataSource)
Iterable data source.
This reader produces GenericRecord instances containing original objects from the datasource.dataSource - the data source to read records from.public void open()
throws RecordReaderOpeningException
RecordReaderopen in interface RecordReaderRecordReaderOpeningException - thrown if an exception occurs during reader openingpublic boolean hasNextRecord()
RecordReaderhasNextRecord in interface RecordReaderpublic GenericRecord readNextRecord() throws RecordReadingException
RecordReaderreadNextRecord in interface RecordReaderRecordReadingException - thrown if an exception occurs during reading next recordpublic Long getTotalRecords()
RecordReadergetTotalRecords in interface RecordReaderpublic String getDataSourceName()
RecordReadergetDataSourceName in interface RecordReaderpublic void close()
RecordReaderclose in interface RecordReaderCopyright © 2015. All Rights Reserved.