public abstract class BatchReader extends Object implements RecordReader
| Modifier and Type | Field and Description |
|---|---|
protected int |
batchSize |
protected long |
currentRecordNumber |
protected RecordReader |
delegate |
| Constructor and Description |
|---|
BatchReader(int batchSize,
RecordReader delegate) |
| 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.
|
abstract boolean |
hasNextRecord()
Check if the reader has a next record.
|
void |
open()
Open the reader.
|
abstract Batch |
readNextRecord()
Read next record from the data source.
|
protected RecordReader delegate
protected int batchSize
protected long currentRecordNumber
public BatchReader(int batchSize,
RecordReader delegate)
public void open()
throws RecordReaderOpeningException
RecordReaderopen in interface RecordReaderRecordReaderOpeningException - thrown if an exception occurs during reader openingpublic abstract boolean hasNextRecord()
RecordReaderhasNextRecord in interface RecordReaderpublic abstract Batch 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()
throws RecordReaderClosingException
RecordReaderclose in interface RecordReaderRecordReaderClosingException - thrown if an exception occurs during reader closingCopyright © 2015. All Rights Reserved.