|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRecordWriter<T extends Record>
Method Summary | |
---|---|
int |
availableRecords()
The number of readily available for consumption Record s |
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 |
java.net.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,
java.util.concurrent.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,
java.util.concurrent.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)
Stores the provided Record to the underlying IBuffer |
boolean |
put(T record,
long timeout,
java.util.concurrent.TimeUnit unit)
Stores the provided Record to the underlying IBuffer . |
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()
The number of total Record s that have passed through the IBuffer this far |
Method Detail |
---|
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 it
store
- the store which serves the writer
GRS2WriterException
- the operation could not be completedint getCapacity() throws GRS2WriterException
IBuffer
capacity used
GRS2WriterException
- the operation could not be completedIBuffer.getCapacity()
java.net.URI getLocator() throws GRS2WriterException
IBuffer
created through the IWriterProxy
provided at
writer initialization
GRS2WriterException
- the operation could not be completedIBuffer.Status getStatus()
IBuffer
IBuffer.getStatus()
int availableRecords() throws GRS2WriterException
Record
s
GRS2WriterException
- the operation could not be completedIBuffer.availableRecords()
long totalRecords() throws GRS2WriterException
Record
s that have passed through the IBuffer
this far
Record
s that have passed through the IBuffer
this far
GRS2WriterException
- the operation could not be completedIBuffer.totalRecords()
boolean put(T record) throws GRS2WriterException
Record
to the underlying IBuffer
record
- the Record
to add
IBuffer
has reached its capacity
GRS2WriterException
- the operation could not be completedIBuffer.put(Record)
boolean put(T record, long timeout, java.util.concurrent.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 writers
record
- the Record
to addtimeout
- the timeout to wait forunit
- the unit of time to use to interpret the timeout value
IBuffer
has reached its capacity and the timeout expired
GRS2WriterException
- 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 RecordWriter
IBuffer
has reached its capacity
GRS2Exception
- an error has occurredput(Record)
boolean importRecord(T record, long timeout, java.util.concurrent.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 RecordWriter
IBuffer
has reached its capacity and the timeout expired
GRS2Exception
- 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 value
record
- the Record
to import to this RecordWriter
newDefinitionIndex
- the definition index that the Record
will have in this RecordWriter
IBuffer
has reached its capacity
GRS2Exception
- an error has occurredRecordWriter.put(Record)
boolean importRecord(T record, int newDefinitionIndex, long timeout, java.util.concurrent.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 value
record
- the Record
to import to this RecordWriter
newDefinitionIndex
- the definition index that the Record
will have in this RecordWriter
IBuffer
has reached its capacity and the timeout expired
GRS2Exception
- an error has occurredRecordWriter.put(Record, long, TimeUnit)
void close() throws GRS2WriterException
Record
s can be added
GRS2WriterException
- the operation could not be completedIBuffer.close()
void dispose()
IBuffer
, their resources will also be disposed
IBuffer.dispose()
void emit(BufferEvent event) throws GRS2WriterException, GRS2WriterInvalidArgumentException
BufferEvent.EventSource.Writer
event
- the event to send to the reader
GRS2WriterException
- the operation could not be completed
GRS2WriterInvalidArgumentException
- the event provided cannot be nullBufferEvent receive() throws GRS2WriterException
GRS2WriterException
- the operation could not be completed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |