Package nz.org.riskscape.engine.task
Interface ReadPageBuffer
- All Known Subinterfaces:
PageBuffer
- All Known Implementing Classes:
CombinedPageBuffer
,LinkedListBuffer
public interface ReadPageBuffer
Buffer that a WorkerTask
reads output from. The Tuple
input
is split into chunks ('pages') to allow for parallelization (i.e. different
threads can each work on their own page of input, which they read from this
shared input buffer.
-
Method Details
-
isEmpty
boolean isEmpty()- Returns:
- true if there are no more pages in the buffer to read (because we're waiting for the upstream worker task to write more).
-
isComplete
boolean isComplete()- Returns:
- true if there are no more pages in the buffer to read (because the upstream worker task has finished writing all its output).
-
read
Page.ReadOnlyPage read()- Returns:
- a page of Tuples to read, or null if there's no Tuples to read
-
numTuplesRead
long numTuplesRead()- Returns:
- the total number of Tuples read from the buffer (for diagnostics).
-
size
int size()- Returns:
- the number of unread tuples in unallocated pages in this buffer. It doesn't include the number of tuples that are in pages currently being read.
-