|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IRecordReader<T extends Record>
| Method Summary | |
|---|---|
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()
Retrieves the next available Record from the IBuffer. |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit)
Retrieves the next available Record from the IBuffer. |
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. |
java.util.concurrent.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. |
java.util.concurrent.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. |
java.util.Iterator<T> |
iterator()
|
BufferEvent |
receive()
Receives a previously emitted event from a writer. |
long |
seek(long len)
Seeks the number of Records provided in the list of Records available. |
void |
setIteratorTimeout(long iteratorTimeout)
The timeout that should be used by the Iterators that are created by this reader. |
void |
setIteratorTimeUnit(java.util.concurrent.TimeUnit iteratorTimeUnit)
The time unit that should be used by the Iterators that are created by this reader. |
long |
totalRecords()
The number of total Records that have passed through the IBuffer this far. |
boolean |
waitAvailable(long timeout,
java.util.concurrent.TimeUnit unit)
Makes sure that within the provided time frame, there is a Record that can be retrieved without blocking. |
| Method Detail |
|---|
RecordDefinition[] getRecordDefinitions()
throws GRS2ReaderException
RecordDefinitions that define the Records that are accessible through the reader.
RecordDefinitions as were provided by the corresponding writer
GRS2ReaderException - 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()
java.util.concurrent.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 used
GRS2ReaderException - 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 far.
Records that have passed through the IBuffer this far
GRS2ReaderException - 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 reader
GRS2ReaderException - the operation could not be completed because no records were retrieved yet
T 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 available
GRS2ReaderException - the operation could not be completedIBuffer.get()
T get(long timeout,
java.util.concurrent.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 value
Record retrieved, or null if the timeout expired without a Record becoming available
GRS2ReaderException - the operation could not be completedIBuffer.get()
boolean waitAvailable(long timeout,
java.util.concurrent.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 value
Record available before the timeout has expired, false otherwise
GRS2ReaderException - 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(java.util.concurrent.TimeUnit iteratorTimeUnit)
Iterators that are created by this reader. This value
is interpreted in conjunction with the value of getIteratorTimeout()
iteratorTimeUnit - the time unit
long getIteratorTimeout()
throws GRS2ReaderException
Iterators that are created by this reader. This value
is interpreted in conjunction with the value of getIteratorTimeUnit().
GRS2ReaderExceptionjava.util.concurrent.TimeUnit getIteratorTimeUnit()
Iterators that are created by this reader. This value
is interpreted in conjunction with the value of getIteratorTimeout()
java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends Record>
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 skip
Records actually skipped
GRS2ReaderException - the operation could not be completed
void emit(BufferEvent event)
throws GRS2ReaderException,
GRS2ReaderInvalidArgumentException
BufferEvent.EventSource.Reader.
event - the event to send to the writer
GRS2ReaderException - the operation could not be completed
GRS2ReaderInvalidArgumentException - the event provided cannot be null
BufferEvent receive()
throws GRS2ReaderException
GRS2ReaderException - the operation could not be completed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||