Class CombinedPageBuffer

java.lang.Object
nz.org.riskscape.engine.sched.CombinedPageBuffer
All Implemented Interfaces:
ReadPageBuffer

public class CombinedPageBuffer extends Object implements ReadPageBuffer

Combines multiple ReadPageBuffers into one, for convenience

  • Constructor Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface ReadPageBuffer
      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

      public boolean isComplete()
      Specified by:
      isComplete in interface ReadPageBuffer
      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

      public Page.ReadOnlyPage read()
      Specified by:
      read in interface ReadPageBuffer
      Returns:
      a page of Tuples to read, or null if there's no Tuples to read
    • numTuplesRead

      public long numTuplesRead()
      Specified by:
      numTuplesRead in interface ReadPageBuffer
      Returns:
      the total number of Tuples read from the buffer (for diagnostics).
    • size

      public int size()
      Specified by:
      size in interface ReadPageBuffer
      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.