Class Reader

java.lang.Object
net.quasardb.qdb.ts.Reader
All Implemented Interfaces:
AutoCloseable, Iterator<WritableRow>

public class Reader extends Object implements AutoCloseable, Iterator<WritableRow>
High-performance bulk reader for a QuasarDB timeseries table. This class follows the general Iterator pattern, and allows you to scan entire timeseries tables in bulk.
  • Constructor Details

  • Method Details

    • getTable

      public Table getTable()
      Returns:
      The underlying table that is being written to.
    • finalize

      protected void finalize() throws Throwable
      Cleans up the internal representation of the local table.
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • close

      public void close() throws IOException
      Closes the timeseries table and local cache so that memory can be reclaimed.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • hasNext

      public boolean hasNext()
      Check whether there is another row available for reading or not. When this function returns true, it is safe to call next.
      Specified by:
      hasNext in interface Iterator<WritableRow>
      Returns:
      Returns true when another row is available for reading.
    • next

      public WritableRow next() throws InvalidIteratorException
      Modifies internal state to move forward to the next row. Make sure to check whether it is safe to read the next row using hasNext().
      Specified by:
      next in interface Iterator<WritableRow>
      Returns:
      The next row.
      Throws:
      InvalidIteratorException - Thrown when the iterator has reached the end and no next row is available.
    • stream

      public Stream<WritableRow> stream()
      Provides stream-based access.