T - the type of elements in the collectionpublic class CollectionReader<T> extends DataReader
Collection, Iterator, or Stream.
Each element in the collection is converted to a Record using a provided converter function.DataReaderDataEndpoint.StatefieldLineage, recordLineagelastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
CollectionReader(Collection<T> collection,
Function<T,Record> recordConverterFunction)
Creates a CollectionReader from a Collection.
|
CollectionReader(Iterator<T> iterator,
Function<T,Record> recordConverterFunction)
Creates a CollectionReader from an Iterator.
|
CollectionReader(Stream<T> stream,
Function<T,Record> recordConverterFunction)
Creates a CollectionReader from a Stream.
|
| Modifier and Type | Method and Description |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds exception properties for debugging purposes.
|
protected Record |
elementToRecord(T nextElement)
Converts an element to a Record using the converter function.
|
protected Collection<T> |
getCollection()
Gets the underlying collection, if available.
|
protected Iterator<T> |
getIterator()
Gets the iterator used to read elements.
|
protected Function<T,Record> |
getRecordConverterFunction()
Gets the function used to convert elements to Records.
|
protected Record |
readImpl()
Overridden by subclasses to read the next record from this
DataReader. |
addLineage, available, getBufferSize, getNestedEndpoint, getNestedReader, getReader, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, pop, push, read, setSaveLineage, skipclose, decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, open, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptionpublic CollectionReader(Collection<T> collection, Function<T,Record> recordConverterFunction)
collection - the collection to read from, or null for an empty collectionrecordConverterFunction - function to convert each element to a Recordpublic CollectionReader(Iterator<T> iterator, Function<T,Record> recordConverterFunction)
iterator - the iterator to read from, or null for an empty iteratorrecordConverterFunction - function to convert each element to a Recordprotected Record readImpl() throws Throwable
DataReaderDataReader. The default
implementation of DataReader.read() now insures that this method will not be called again after it returns
a null.
If no record is available, null will be returned.
readImpl in class DataReaderThrowableprotected Record elementToRecord(T nextElement)
nextElement - the element to convertprotected Collection<T> getCollection()
protected Iterator<T> getIterator()
protected Function<T,Record> getRecordConverterFunction()
public DataException addExceptionProperties(DataException exception)
addExceptionProperties in class DataReaderexception - the exception to add properties toCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.