|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
E - The generic type of the elements in the chunks.public interface IBlockingBuffer<E>
Interface provides an iterator to drain chunks from an IBuffer.
This interface is useful where one (or more) processes will write
asynchronously on the IBuffer while another drains it via the
iterator(). For better performance in a multi-threaded environment,
each thread is given an UnsynchronizedArrayBuffer of some capacity.
The threads populate their UnsynchronizedArrayBuffers in parallel
using non-blocking operations. The UnsynchronizedArrayBuffers in
turn are configured to flush chunks of elements onto an either an
IBuffer whose generic type is E[]. Each element in
the target IBuffer is therefore a chunk of elements from one of the
source UnsynchronizedArrayBuffers.
There are two families of synchronized IBuffers
IBuffer that targets a mutable IRelation;IBlockingBuffer that exposes an IAsynchronousIterator
for reading chunks of elements.
This design means that blocking operations are restricted to chunk-at-a-time
operations, primarily when an UnsynchronizedArrayBuffer<E>
overflows onto an IBuffer<<E[]> and when the
IBuffer<<E[]> either is flushed onto an
IMutableRelation or drained by an IChunkedIterator.
| Method Summary | |
|---|---|
long |
flush()
This is a NOP since the iterator() is the only way to consume
data written on the buffer. |
IAsynchronousIterator<E> |
iterator()
Return an iterator reading from the buffer. |
void |
setFuture(Future future)
Set the Future for the source processing writing on the
IBlockingBuffer. |
| Methods inherited from interface com.bigdata.relation.accesspath.IRunnableBuffer |
|---|
abort, add, close, getFuture, isOpen |
| Methods inherited from interface com.bigdata.relation.accesspath.IBuffer |
|---|
isEmpty, reset, size |
| Method Detail |
|---|
IAsynchronousIterator<E> iterator()
IBlockingBuffer by concurrent
processes in which case the order is not predictable without additional
synchronization.
long flush()
iterator() is the only way to consume
data written on the buffer.
flush in interface IBuffer<E>void setFuture(Future future)
Future for the source processing writing on the
IBlockingBuffer.
future - The Future.
IllegalArgumentException - if the argument is null.
IllegalStateException - if the future has already been set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||