Package io.delta.kernel.utils
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
Closeable extension of
Iterator- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault CloseableIterator<T>combine(CloseableIterator<T> other) Combine the current iterator with another iterator.default CloseableIterator<T>booleanhasNext()Returns true if the iteration has more elements.default <U> CloseableIterator<U>next()Returns the next element in the iteration.Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
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:
hasNextin interfaceIterator<T>- Returns:
- true if the iteration has more elements
- Throws:
KernelEngineException- For any underlying exception occurs inEnginewhile trying to execute the operation. The original exception is (if any) wrapped in this exception as cause. E.g.IOExceptionthrown 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:
nextin interfaceIterator<T>- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException- if the iteration has no more elementsKernelEngineException- For any underlying exception occurs inEnginewhile trying to execute the operation. The original exception is (if any) wrapped in this exception as cause. E.g.IOExceptionthrown 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
-
filter
-
combine
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
-