public class AsyncReader extends ProxyReader
DataEndpoint.State| Modifier and Type | Field and Description |
|---|---|
protected Object |
lock |
static int |
MINIMUM_BUFFER_SIZE |
fieldLineage, recordLineagelastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
AsyncReader(DataReader reader) |
| Modifier and Type | Method and Description |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException. |
protected DataException |
addExceptionPropertiesImpl(DataException exception) |
int |
available()
Returns the number of records that can probably be read without blocking.
|
void |
close()
Indicates that this endpoint has finished reading or writing.
|
DataException |
exception(String message)
Creates an exception with the specified message and containing this endpoint's properties (name-value pairs).
|
DataException |
exception(String message,
Throwable exception)
Converts an exception to a
DataException, prefixing the original message with the specified text
and adding this endpoint's properties (name-value pairs). |
DataException |
exception(Throwable exception)
Converts an exception to a
DataException and adds this endpoint's properties (name-value pairs). |
protected void |
fillCache() |
long |
getBufferSizeInBytes() |
DataException |
getException() |
long |
getMaxBufferSizeInBytes() |
long |
getPeakBufferSizeInBytes() |
int |
getPriority() |
void |
open()
Makes this endpoint ready for reading or writing.
|
protected Record |
pop()
Removes and returns the next record in this
DataReaders buffer or null if it is empty. |
void |
push(Record record)
Adds a record to this
DataReaders buffer. |
protected Record |
readImpl()
Overridden by subclasses to read the next record from this
DataReader. |
void |
rethrowAsyncException()
Rethrows the exception thrown by the internal thread or returns silently if no exception was thrown.
|
AsyncReader |
setMaxBufferSizeInBytes(long maxBufferSize) |
AsyncReader |
setPriority(int priority) |
getNestedReader, interceptRecord, map, map, setNestedDataReader, setNestedDataReaderaddLineage, getBufferSize, getNestedEndpoint, getReader, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, read, setSaveLineage, skipdecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptiongetId, getName, resetIDpublic static final int MINIMUM_BUFFER_SIZE
protected final Object lock
public AsyncReader(DataReader reader)
public long getMaxBufferSizeInBytes()
public AsyncReader setMaxBufferSizeInBytes(long maxBufferSize)
public long getBufferSizeInBytes()
public long getPeakBufferSizeInBytes()
public int getPriority()
public AsyncReader setPriority(int priority)
public DataException getException()
public void open()
throws DataException
DataEndpointopen in class ProxyReaderDataExceptionpublic void close()
throws DataException
DataEndpointclose in class ProxyReaderDataExceptionpublic void push(Record record)
DataReaderDataReaders buffer. Records in the buffer will be returned
by DataReader.read() before attempting to read from the underlying implementation.push in class DataReaderDataReader.read()protected Record pop()
DataReaderDataReaders buffer or null if it is empty.pop in class DataReaderDataReader.push(Record)public int available()
throws DataException
DataReaderavailable in class ProxyReaderDataExceptionprotected void fillCache()
public void rethrowAsyncException()
protected 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 ProxyReaderThrowablepublic final DataException exception(String message, Throwable exception)
DataObjectDataException, prefixing the original message with the specified text
and adding this endpoint's properties (name-value pairs).
The returned exception can then be thrown in the normal way.
If the supplied exception is an instanceof DataException, it will be returned, otherwise it will be
nested inside a DataException. In either case the result message will contain the new prefix along
with this endpoint properties.
exception in class DataObjectpublic final DataException exception(Throwable exception)
DataObjectDataException and adds this endpoint's properties (name-value pairs).
The returned exception can then be thrown in the normal way.
If the supplied exception is an instanceof DataException, it will be returned, otherwise it will be
nested inside a DataException. In either case the result message will contain this endpoint properties.
exception in class DataObjectpublic final DataException exception(String message)
DataObjectThe returned exception can then be thrown in the normal way.
exception in class DataObjectpublic final DataException addExceptionProperties(DataException exception)
EndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in class ProxyReaderprotected DataException addExceptionPropertiesImpl(DataException exception)
Copyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.