@Public public interface RecordReader<T> extends Closeable
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
RecordReader.RecordIterator<T>
An internal iterator interface which presents a more restrictive API than
Iterator. |
| 限定符和类型 | 方法和说明 |
|---|---|
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 |
forIOEachRemaining(ConsumerWithIOException<? 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. |
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.
IOExceptionvoid close()
throws IOException
close 在接口中 AutoCloseableclose 在接口中 CloseableIOExceptiondefault void forEachRemaining(java.util.function.Consumer<? super T> action) throws IOException
RecordReader until all
elements have been processed or the action throws an exception.IOExceptiondefault void forIOEachRemaining(ConsumerWithIOException<? super T> action) throws IOException
RecordReader until all
elements have been processed or the action throws an exception.IOExceptiondefault <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 The Apache Software Foundation. All rights reserved.