public class TimedReader extends ProxyReader
DataEndpoint.State
fieldLineage, recordLineage
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
TimedReader(DataReader reader,
long maxTime) |
Modifier and Type | Method and Description |
---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException . |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
long |
getMaxTime() |
boolean |
isTimeExpired()
Returns
true if reading stopped due to the time expiring. |
void |
open()
Makes this endpoint ready for reading or writing.
|
Record |
read()
Reads the next record from this
DataReader and increases the record-count by 1. |
String |
toString() |
available, getNestedReader, interceptRecord, map, map, readImpl, setNestedDataReader, setNestedDataReader
addLineage, getBufferSize, getNestedEndpoint, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, pop, push, setSaveLineage, skip
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public TimedReader(DataReader reader, long maxTime)
public long getMaxTime()
public void open() throws DataException
DataEndpoint
open
in class ProxyReader
DataException
public void close() throws DataException
DataEndpoint
close
in class ProxyReader
DataException
public Record read()
DataReader
DataReader
and increases the record-count by 1.
This method will first read any pushed (DataReader.push(Record)
) records before reading from the underlying source.
If no record is available, null
will be returned. This method blocks until a record is available,
the end of the stream is reached, or an exception is thrown.
Any exception raised while reading will be converted to a DataException
using DataObject.exception(Throwable)
.
Subclasses generally do not need to override this method, instead they should implement DataReader.readImpl()
.
read
in class DataReader
DataReader.push(Record)
,
DataReader.peek(int)
,
DataReader.read()
public DataException addExceptionProperties(DataException exception)
Endpoint
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in class ProxyReader
public String toString()
toString
in class DataEndpoint
public boolean isTimeExpired()
true
if reading stopped due to the time expiring.Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.