[prev] 28 [next]

Iterators (reminder)

Iterators provide a "stream" of results:
  • iter = startScan(params)
    • set up data structures for iterator   (create state, open files, ...)
    • params are specific to operator  (e.g. reln, condition, #buffers, ...)
  • tuple = nextTuple(iter)
    • get the next tuple in the iteration; return null if no more
  • endScan(iter)
    • clean up data structures for iterator
Other possible operations: reset to specific point, restart, ...