Package nz.org.riskscape.engine.task
Interface WritePageBuffer
- All Known Subinterfaces:
PageBuffer
- All Known Implementing Classes:
LinkedListBuffer
public interface WritePageBuffer
Buffer that a WorkerTask
writes output to. The Tuple
output
is split into chunks ('pages') to allow for parallelization (i.e. different
threads can each work on their own page of output, which they then add to
this shared output buffer.
-
Method Details
-
add
Adds a page of output Tuples to the buffer.
-
isFull
boolean isFull()- Returns:
- true if the WritePageBuffer has reached capacity. If so, the downstream
worker task needs to read pages from the buffer before more can be written.
Note that due to supporting multi-threaded writers, this is a polite back-off
that the writing worker task should honour, rather than a hard limit, i.e.
newPage()
andadd(Page page)
will not strictly enforce the capacity limit.
-
newPage
Page newPage()Allocates a new page to write Tuples to. Note that
add(Page page)
actually adds the Tuples to the buffer. -
markComplete
void markComplete()Signals to the downstream worker task that this process has now completed writing all its output to the buffer.
-
numTuplesWritten
long numTuplesWritten()- Returns:
- the total number of Tuples written to this buffer (for diagnostics).
-
numTuplesRead
long numTuplesRead() -
getTupleCapacity
int getTupleCapacity()
-