Interface SnapshotResult

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
DeleteQueryListener, SnapshotQueryListener

public interface SnapshotResult extends Closeable
A blocking iterator pattern for retrieving snapshot only results.
Since:
2.0 SnapshotResult extends Iterable<Tuple>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    closes any resource associated with the snapshot result
    Retrieves the fields describing the tuples that will be returned.
    boolean
    See if there are more tuples to retrieve.
    Retrieves the next tuple in the result.
  • Method Details

    • hasNext

      boolean hasNext() throws LiveViewException
      See if there are more tuples to retrieve. If there are not currently any Tuples waiting to be read, this will block until either the next Tuple or the Snapshot end arrives.
      Returns:
      true if more tuples exist in result
      Throws:
      LiveViewException
    • next

      Retrieves the next tuple in the result. If there are not currently any Tuples waiting to be read, this will block until either the next Tuple or the Snapshot end arrives.
      Returns:
      the next tuple
      Throws:
      LiveViewException - if exception occurs on the Query
      NoSuchElementException - if no more tuples exist to retrieve
    • getFields

      List<Schema.Field> getFields() throws LiveViewException
      Retrieves the fields describing the tuples that will be returned.
      Returns:
      the fields describing the tuples
      Throws:
      LiveViewException - if exception occurs on the Query
    • close

      void close()
      closes any resource associated with the snapshot result
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable