Interface CloseableIterator<T>

Type Parameters:
T - the type of elements returned by this iterator
All Superinterfaces:
AutoCloseable, Closeable, Iterator<T>
All Known Implementing Classes:
CreateCheckpointIterator

@Evolving public interface CloseableIterator<T> extends Iterator<T>, Closeable
Closeable extension of Iterator
Since:
3.0.0
  • Method Details

    • hasNext

      boolean hasNext()
      Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
      Specified by:
      hasNext in interface Iterator<T>
      Returns:
      true if the iteration has more elements
      Throws:
      KernelEngineException - For any underlying exception occurs in Engine while trying to execute the operation. The original exception is (if any) wrapped in this exception as cause. E.g. IOException thrown while trying to read from a Delta log file. It will be wrapped in this exception as cause.
      KernelException - When encountered an operation or state that is invalid or unsupported.
    • next

      T next()
      Returns the next element in the iteration.
      Specified by:
      next in interface Iterator<T>
      Returns:
      the next element in the iteration
      Throws:
      NoSuchElementException - if the iteration has no more elements
      KernelEngineException - For any underlying exception occurs in Engine while trying to execute the operation. The original exception is (if any) wrapped in this exception as cause. E.g. IOException thrown while trying to read from a Delta log file. It will be wrapped in this exception as cause.
      KernelException - When encountered an operation or state that is invalid or unsupported in Kernel. For example, trying to read from a Delta table that has advanced features which are not yet supported by Kernel.
    • map

      default <U> CloseableIterator<U> map(Function<T,U> mapper)
    • filter

      default CloseableIterator<T> filter(Function<T,Boolean> mapper)
    • combine

      default CloseableIterator<T> combine(CloseableIterator<T> other)
      Combine the current iterator with another iterator. The resulting iterator will return all elements from the current iterator followed by all elements from the other iterator.
      Parameters:
      other - the other iterator to combine with
      Returns:
      a new iterator that combines the current iterator with the other iterator