public interface IRecordReader<T extends Record> extends Iterable<T>
| Modifier and Type | Method and Description |
|---|---|
int |
availableRecords()
The number of readily available for consumption
Records. |
void |
close()
Closes and disposes the underlying buffer.
|
long |
currentRecord()
The index of the last
Record retrieved through the reader. |
void |
emit(BufferEvent event)
Emits the provided event to the writer.
|
T |
get()
|
T |
get(long timeout,
TimeUnit unit)
|
int |
getCapacity()
The underlying
IBuffer capacity used. |
int |
getConcurrentPartialCapacity()
The underlying
IBuffer concurrent partial capacity used |
long |
getInactivityTimeout()
Retrieves the Inactivity timeout set for the lifecycle management of the underlying
IBuffer. |
TimeUnit |
getInactivityTimeUnit()
Retrieves the Inactivity time unit set for the lifecycle management of the underlying
IBuffer. |
long |
getIteratorTimeout()
The timeout that is used by the
Iterators that are created by this reader. |
TimeUnit |
getIteratorTimeUnit()
The time unit that is used by the
Iterators that are created by this reader. |
RecordDefinition[] |
getRecordDefinitions()
Retrieves the
RecordDefinitions that define the Records that are accessible through the reader. |
IBuffer.Status |
getStatus()
Retrieves the status of the underlying
IBuffer. |
Iterator<T> |
iterator() |
BufferEvent |
receive()
Receives a previously emitted event from a writer.
|
long |
seek(long len)
|
void |
setIteratorTimeout(long iteratorTimeout)
The timeout that should be used by the
Iterators that are created by this reader. |
void |
setIteratorTimeUnit(TimeUnit iteratorTimeUnit)
The time unit that should be used by the
Iterators that are created by this reader. |
long |
totalRecords()
|
boolean |
waitAvailable(long timeout,
TimeUnit unit)
Makes sure that within the provided time frame, there is a
Record that can be retrieved without blocking. |
RecordDefinition[] getRecordDefinitions() throws GRS2ReaderException
RecordDefinitions that define the Records that are accessible through the reader.RecordDefinitions as were provided by the corresponding writerGRS2ReaderException - the operation could not be completedIBuffer.getRecordDefinitions()long getInactivityTimeout()
throws GRS2ReaderException
IBuffer. This value
should be interpreted in conjunction with the value of getInactivityTimeUnit().GRS2ReaderException - the operation could not be completedIBuffer.getInactivityTimeout()TimeUnit getInactivityTimeUnit() throws GRS2ReaderException
IBuffer. This value
should be interpreted in conjunction with the value of getInactivityTimeout()GRS2ReaderException - the operation could not be completedIBuffer.getInactivityTimeUnit()int getCapacity()
throws GRS2ReaderException
IBuffer capacity used.GRS2ReaderException - the operation could not be completedIBuffer.getCapacity()int getConcurrentPartialCapacity()
throws GRS2ReaderException
IBuffer concurrent partial capacity usedGRS2ReaderException - the operation could not be completedIBuffer.getConcurrentPartialCapacity()IBuffer.Status getStatus()
IBuffer.IBuffer.getStatus()void close()
throws GRS2ReaderException
GRS2ReaderException - the operation could not be completedIBuffer.close(),
IBuffer.dispose()long totalRecords()
throws GRS2ReaderException
Records that have passed through the IBuffer this farGRS2ReaderException - the operation could not be completedIBuffer.totalRecords()int availableRecords()
throws GRS2ReaderException
Records.GRS2ReaderException - the operation could not be completedIBuffer.availableRecords()long currentRecord()
throws GRS2ReaderException
Record retrieved through the reader.Record retrieved through the readerGRS2ReaderException - the operation could not be completed because no records were retrieved yetT get() throws GRS2ReaderException
Record from the IBuffer. An explicit cast is performed to the
type provided in the generic declaration of the reader.Record or null if none was readily availableGRS2ReaderException - the operation could not be completedIBuffer.get()T get(long timeout, TimeUnit unit) throws GRS2ReaderException
Record from the IBuffer. An explicit cast is performed to the
type provided in the generic declaration of the reader. If no record is readily available the reader will
block for a maximum of timeout unit units of time waiting for a record to become
available or until the IBuffer uses the IBuffer.getReaderImmediateNotificationObject()
to notify blocked readers.timeout - the timeout to wait forunit - the unit of time to use to interpret the timeout valueRecord retrieved, or null if the timeout expired without a Record becoming availableGRS2ReaderException - the operation could not be completedIBuffer.get()boolean waitAvailable(long timeout,
TimeUnit unit)
throws GRS2ReaderException
Record that can be retrieved without blocking.
If the timeout defined expires and no Record has been made available, false is returned. Otherwise, or if
there are already available Records, true is returned.timeout - the timeout value interpreted in conjunction with the unit valueunit - the time unit to use to interpret the timeout valueRecord available before the timeout has expired, false otherwiseGRS2ReaderException - the operation could not be completedvoid setIteratorTimeout(long iteratorTimeout)
Iterators that are created by this reader. This value
is interpreted in conjunction with the value of getIteratorTimeUnit()iteratorTimeout - the timeoutvoid setIteratorTimeUnit(TimeUnit iteratorTimeUnit)
Iterators that are created by this reader. This value
is interpreted in conjunction with the value of getIteratorTimeout()iteratorTimeUnit - the time unitlong getIteratorTimeout()
throws GRS2ReaderException
Iterators that are created by this reader. This value
is interpreted in conjunction with the value of getIteratorTimeUnit().GRS2ReaderExceptionTimeUnit getIteratorTimeUnit()
Iterators that are created by this reader. This value
is interpreted in conjunction with the value of getIteratorTimeout()long seek(long len)
throws GRS2ReaderException
Records provided in the list of Records available.
Depending on the actual IRecordReader implementation, forward and/or backward seeks may be supported.len - the number of Record}s to skipRecords actually skippedGRS2ReaderException - the operation could not be completedvoid emit(BufferEvent event) throws GRS2ReaderException, GRS2ReaderInvalidArgumentException
BufferEvent.EventSource.Reader.event - the event to send to the writerGRS2ReaderException - the operation could not be completedGRS2ReaderInvalidArgumentException - the event provided cannot be nullBufferEvent receive() throws GRS2ReaderException
GRS2ReaderException - the operation could not be completedCopyright © 2014. All Rights Reserved.