Package org.apache.iceberg.io
Interface CloseableIterable<T>
- All Superinterfaces:
- AutoCloseable,- Closeable,- Iterable<T>
- All Known Implementing Classes:
- AvroIterable,- CloseableIterable.ConcatCloseableIterable,- ManifestReader,- ParallelIterable,- ParquetIterable,- ParquetReader,- SortedMerge,- VectorizedParquetReader,- VectorizedTableScanIterable
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionstatic <E> CloseableIterable<E> static <E> CloseableIterable<E> concat(Iterable<CloseableIterable<E>> iterable) static <T> CloseableIterable<T> count(Counter counter, CloseableIterable<T> iterable) Counts the number of elements in the givenCloseableIterableby incrementing theCounterinstance for eachIterator.next()call.static <E> CloseableIterable<E> empty()static <E> CloseableIterable<E> filter(CloseableIterable<E> iterable, Predicate<E> pred) static <E> CloseableIterable<E> filter(Counter skipCounter, CloseableIterable<E> iterable, Predicate<E> pred) Filters the givenCloseableIterableand counts the number of elements that do not match the predicate by incrementing theCounter.iterator()Returns a closeable iterator over elements of typeT.static <E> CloseableIterable<E> Adapts an Iterable to CloseableIterable using a no-op close if it is not Closeable.static <I,O> CloseableIterable <O> transform(CloseableIterable<I> iterable, Function<I, O> transform) static <E> CloseableIterable<E> whenComplete(CloseableIterable<E> iterable, Runnable onCompletionRunnable) Will run the given runnable whenCloseable.close()has been called.static <E> CloseableIterable<E> withNoopClose(E entry) static <E> CloseableIterable<E> withNoopClose(Iterable<E> iterable) Methods inherited from interface java.lang.IterableforEach, spliterator
- 
Method Details- 
ofAdapts an Iterable to CloseableIterable using a no-op close if it is not Closeable.- Parameters:
- iterable- an Iterable
- Returns:
- a CloseableIterable that closes Iterable if it is Closeable
 
- 
iteratorCloseableIterator<T> iterator()Returns a closeable iterator over elements of typeT.- Specified by:
- iteratorin interface- Iterable<T>
- Returns:
- an CloseableIterator.
 
- 
withNoopClose
- 
withNoopClose
- 
empty
- 
combine
- 
whenCompletestatic <E> CloseableIterable<E> whenComplete(CloseableIterable<E> iterable, Runnable onCompletionRunnable) Will run the given runnable whenCloseable.close()has been called.- Type Parameters:
- E- The type of the underlying iterable
- Parameters:
- iterable- The underlying- CloseableIterableto iterate over
- onCompletionRunnable- The runnable to run after the underlying iterable was closed
- Returns:
- A new CloseableIterablewhere the runnable will be executed as the final step afterCloseable.close()has been called
 
- 
filter
- 
filterstatic <E> CloseableIterable<E> filter(Counter skipCounter, CloseableIterable<E> iterable, Predicate<E> pred) Filters the givenCloseableIterableand counts the number of elements that do not match the predicate by incrementing theCounter.- Type Parameters:
- E- The underlying type to be iterated.
- Parameters:
- skipCounter- The- Counterinstance to increment on each skipped item during filtering.
- iterable- The underlying- CloseableIterableto filter.
- Returns:
- A filtered CloseableIterablewhere the given skipCounter is incremented whenever the predicate does not match.
 
- 
countCounts the number of elements in the givenCloseableIterableby incrementing theCounterinstance for eachIterator.next()call.- Type Parameters:
- T- The underlying type to be iterated.
- Parameters:
- counter- The- Counterinstance to increment on each- Iterator.next()call.
- iterable- The underlying- CloseableIterableto count
- Returns:
- A CloseableIterablethat increments the given counter on eachIterator.next()call.
 
- 
transformstatic <I,O> CloseableIterable<O> transform(CloseableIterable<I> iterable, Function<I, O> transform) 
- 
concat
 
-