I - Input typeO - Mapped output typepublic class RecordMapperWrapperRecordIterator<I,O> extends Object implements BulkFormat.RecordIterator<O>
BulkFormat.RecordIterator
that wraps another iterator and performs the mapping of the records. You can use wrapReader(BulkFormat.Reader, RecordMapper) to wrap a whole reader.| 限定符和类型 | 类和说明 |
|---|---|
static interface |
RecordMapperWrapperRecordIterator.RecordMapper<I,O>
Record mapper definition.
|
| 构造器和说明 |
|---|
RecordMapperWrapperRecordIterator(BulkFormat.RecordIterator<I> wrapped,
RecordMapperWrapperRecordIterator.RecordMapper<I,O> mapper) |
| 限定符和类型 | 方法和说明 |
|---|---|
RecordAndPosition<O> |
next()
Gets the next record from the file, together with its position.
|
void |
releaseBatch()
Releases the batch that this iterator iterated over.
|
static <I,O> BulkFormat.Reader<O> |
wrapReader(BulkFormat.Reader<I> wrappedReader,
RecordMapperWrapperRecordIterator.RecordMapper<I,O> recordMapper)
Wrap a
BulkFormat.Reader applying a RecordMapperWrapperRecordIterator.RecordMapper on the returned iterator. |
public RecordMapperWrapperRecordIterator(BulkFormat.RecordIterator<I> wrapped, RecordMapperWrapperRecordIterator.RecordMapper<I,O> mapper)
public RecordAndPosition<O> next()
BulkFormat.RecordIteratorThe position information returned with the record point to the record AFTER the returned record, because it defines the point where the reading should resume once the current record is emitted. The position information is put in the source's state when the record is emitted. If a checkpoint is taken directly after the record is emitted, the checkpoint must to describe where to resume the source reading from after that record.
Objects returned by this method may be reused by the iterator. By the time that this
method is called again, no object returned from the previous call will be referenced any
more. That makes it possible to have a single MutableRecordAndPosition object and
return the same instance (with updated record and position) on every call.
next 在接口中 BulkFormat.RecordIterator<O>public void releaseBatch()
BulkFormat.RecordIteratorreleaseBatch 在接口中 BulkFormat.RecordIterator<O>public static <I,O> BulkFormat.Reader<O> wrapReader(BulkFormat.Reader<I> wrappedReader, RecordMapperWrapperRecordIterator.RecordMapper<I,O> recordMapper)
BulkFormat.Reader applying a RecordMapperWrapperRecordIterator.RecordMapper on the returned iterator.I - Input typeO - Mapped output typeCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.