T - the type of elements in the queuepublic class BlockingQueueRecordReader<T extends Record> extends Object implements RecordReader
RecordReader that reads record from a BlockingQueue.| Constructor and Description |
|---|
BlockingQueueRecordReader(BlockingQueue<T> queue)
Create a
BlockingQueueRecordReader. |
| 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.
|
T |
readNextRecord()
Read next record from the data source.
|
public BlockingQueueRecordReader(BlockingQueue<T> queue)
BlockingQueueRecordReader.queue - the queue to read records frompublic void open()
RecordReaderopen in interface RecordReaderpublic boolean hasNextRecord()
RecordReaderhasNextRecord in interface RecordReaderpublic T 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.