@Public public interface RecordReader<T> extends Closeable
Modifier and Type | Interface and Description |
---|---|
static interface |
RecordReader.RecordIterator<T>
An internal iterator interface which presents a more restrictive API than
Iterator . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the reader and should release all resources.
|
default RecordReader<T> |
filter(Filter<T> filter)
Filters a
RecordReader . |
default void |
forEachRemaining(java.util.function.Consumer<? super T> action)
Performs the given action for each remaining element in
RecordReader until all
elements have been processed or the action throws an exception. |
default void |
forEachRemainingWithPosition(java.util.function.BiConsumer<Long,? super T> action)
Performs the given action for each remaining element with row position in
RecordReader until all elements have been processed or the action throws an exception. |
RecordReader.RecordIterator<T> |
readBatch()
Reads one batch.
|
default CloseableIterator<T> |
toCloseableIterator()
Convert this reader to a
CloseableIterator . |
default <R> RecordReader<R> |
transform(java.util.function.Function<T,R> function)
Returns a
RecordReader that applies function to each element. |
@Nullable RecordReader.RecordIterator<T> readBatch() throws IOException
The returned iterator object and any contained objects may be held onto by the source for some time, so it should not be immediately reused by the reader.
IOException
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
default void forEachRemaining(java.util.function.Consumer<? super T> action) throws IOException
RecordReader
until all
elements have been processed or the action throws an exception.IOException
default void forEachRemainingWithPosition(java.util.function.BiConsumer<Long,? super T> action) throws IOException
RecordReader
until all elements have been processed or the action throws an exception.IOException
default <R> RecordReader<R> transform(java.util.function.Function<T,R> function)
RecordReader
that applies function
to each element.default RecordReader<T> filter(Filter<T> filter)
RecordReader
.default CloseableIterator<T> toCloseableIterator()
CloseableIterator
.Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.