Class Scan

java.lang.Object
dev.vortex.api.Scan
All Implemented Interfaces:
AutoCloseable, Iterator<Partition>

public final class Scan extends Object implements Iterator<Partition>, AutoCloseable
A lazy handle to a set of partitions.

Call close() to release the scan and any partition prefetched by hasNext() but not yet returned by next(). Partitions already returned remain valid. VortexCleaner releases an unclosed scan when it becomes unreachable.

Native calls are synchronized with close() to prevent another thread from freeing the handle during an operation.

  • Method Details

    • arrowSchema

      public org.apache.arrow.vector.types.pojo.Schema arrowSchema(org.apache.arrow.memory.BufferAllocator allocator)
      Arrow schema produced by this scan. Must be called before the first call to hasNext()/next().
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Partition>
      Throws:
      IllegalStateException - if this scan has been closed
    • next

      public Partition next()
      Specified by:
      next in interface Iterator<Partition>
      Throws:
      IllegalStateException - if this scan has been closed
    • close

      public void close()
      Releases this scan once, without closing partitions already returned to the caller.
      Specified by:
      close in interface AutoCloseable