public interface IRecordWriter<T extends Record>
| Modifier and Type | Method and Description |
|---|---|
int |
availableRecords()
The number of readily available for consumption
Records |
void |
close()
Closes the underlying buffer.
|
void |
dispose()
Disposes the underlying buffer.
|
void |
emit(BufferEvent event)
Emits the provided event to the reader.
|
int |
getCapacity()
The underlying
IBuffer capacity used |
URI |
getLocator() |
IBuffer.Status |
getStatus()
Retrieves the status of the underlying
IBuffer |
boolean |
importRecord(T record)
Dissociates a
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this IRecordWriter. |
boolean |
importRecord(T record,
int newDefinitionIndex)
Dissociates a
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this RecordWriter. |
boolean |
importRecord(T record,
int newDefinitionIndex,
long timeout,
TimeUnit unit)
Dissociates a
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this RecordWriter. |
boolean |
importRecord(T record,
long timeout,
TimeUnit unit)
Dissociates a
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this RecordWriter. |
boolean |
put(T record)
|
boolean |
put(T record,
long timeout,
TimeUnit unit)
|
BufferEvent |
receive()
Receives a previously emitted event from a reader
|
void |
setBufferStore(IBufferStore store)
If this writer is populated by an
IBufferStore this store is provided in order to keep the store
alive and active even after the respective BufferStoreReader has closed the writer but the client
reader is still using it |
long |
totalRecords()
|
void setBufferStore(IBufferStore store) throws GRS2WriterException
IBufferStore this store is provided in order to keep the store
alive and active even after the respective BufferStoreReader has closed the writer but the client
reader is still using itstore - the store which serves the writerGRS2WriterException - the operation could not be completedint getCapacity()
throws GRS2WriterException
IBuffer capacity usedGRS2WriterException - the operation could not be completedIBuffer.getCapacity()URI getLocator() throws GRS2WriterException
IBuffer created through the IWriterProxy provided at
writer initializationGRS2WriterException - the operation could not be completedIBuffer.Status getStatus()
IBufferIBuffer.getStatus()int availableRecords()
throws GRS2WriterException
RecordsGRS2WriterException - the operation could not be completedIBuffer.availableRecords()long totalRecords()
throws GRS2WriterException
Records that have passed through the IBuffer this farGRS2WriterException - the operation could not be completedIBuffer.totalRecords()boolean put(T record) throws GRS2WriterException
record - the Record to addIBuffer has reached its capacityGRS2WriterException - the operation could not be completedIBuffer.put(Record)boolean put(T record, long timeout, TimeUnit unit) throws GRS2WriterException
Record to the underlying IBuffer. If the IBuffer has already reached
its capacity, the method will block for a maximum of timeout unit units of time waiting
for a record to be consumed or until the IBuffer uses the IBuffer.getWriterImmediateNotificationObject()
to notify blocked writersrecord - the Record to addtimeout - the timeout to wait forunit - the unit of time to use to interpret the timeout valueIBuffer has reached its capacity and the timeout expiredGRS2WriterException - the operation could not be completedIBuffer.put(Record)boolean importRecord(T record) throws GRS2Exception
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this IRecordWriter.
Before put(Record) is called, the record is unbound from the buffer to which is associated, and its definition index
is re-set to the same value it had before.
Equivalent to calling importRecord(Record, int) with the second parameter being equal to
Record.getDefinitionIndex(). Used for convenience if this IRecordWriter is associated with the same definitions as
the reader from which the record is originating
record - the Record to import to the RecordWriterIBuffer has reached its capacityGRS2Exception - an error has occurredput(Record)boolean importRecord(T record, long timeout, TimeUnit unit) throws GRS2Exception
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this RecordWriter.
Before RecordWriter.put(Record, long, TimeUnit) is called, the record is unbound from the buffer to which is associated,
and its definition index is re-set to the same value it had before.
Equivalent to calling RecordWriter.importRecord(Record, int, long, TimeUnit) with the second parameter being equal to
Record.getDefinitionIndex(). Used for convenience if this RecordWriter is associated with the same definitions as
the reader from which the record is originating
record - the Record to import to the RecordWriterIBuffer has reached its capacity and the timeout expiredGRS2Exception - an error has occurredRecordWriter.put(Record, long, TimeUnit)boolean importRecord(T record, int newDefinitionIndex) throws GRS2Exception
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this RecordWriter.
Before RecordWriter.put(Record) is called, the record is unbound from the buffer to which is associated, and its definition index
is set to the supplied valuerecord - the Record to import to this RecordWriternewDefinitionIndex - the definition index that the Record will have in this RecordWriterIBuffer has reached its capacityGRS2Exception - an error has occurredRecordWriter.put(Record)boolean importRecord(T record, int newDefinitionIndex, long timeout, TimeUnit unit) throws GRS2Exception
Record from the underlying IBuffer of a producer and stores it to the IBuffer of
this RecordWriter.
Before RecordWriter.put(Record, long, TimeUnit) is called, the record is unbound from the buffer to which is associated,
and its definition index is set to the supplied valuerecord - the Record to import to this RecordWriternewDefinitionIndex - the definition index that the Record will have in this RecordWriterIBuffer has reached its capacity and the timeout expiredGRS2Exception - an error has occurredRecordWriter.put(Record, long, TimeUnit)void close()
throws GRS2WriterException
Records can be addedGRS2WriterException - the operation could not be completedIBuffer.close()void dispose()
IBuffer, their resources will also be disposedIBuffer.dispose()void emit(BufferEvent event) throws GRS2WriterException, GRS2WriterInvalidArgumentException
BufferEvent.EventSource.Writerevent - the event to send to the readerGRS2WriterException - the operation could not be completedGRS2WriterInvalidArgumentException - the event provided cannot be nullBufferEvent receive() throws GRS2WriterException
GRS2WriterException - the operation could not be completedCopyright © 2014. All Rights Reserved.