T - record type.SplitT - source split type.public interface SourceReader<T,SplitT extends SourceSplit> extends AutoCloseable, CheckpointListener
SourceReader is used to generate source record, and it will be running at worker.| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
SourceReader.Context |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addSplits(List<SplitT> splits)
Add the split checkpoint state to reader.
|
void |
close()
Called to close the reader, in case it holds on to any resources, like threads or network
connections.
|
void |
handleNoMoreSplits()
This method is called when the reader is notified that it will not receive any further
splits.
|
default void |
handleSourceEvent(SourceEvent sourceEvent)
Handle the source event form
SourceSplitEnumerator. |
void |
open()
Open the source reader.
|
void |
pollNext(Collector<T> output)
Generate the next batch of records.
|
List<SplitT> |
snapshotState(long checkpointId)
Get the current split checkpoint state by checkpointId.
|
notifyCheckpointAborted, notifyCheckpointCompletevoid close()
throws IOException
close 在接口中 AutoCloseableIOExceptionvoid pollNext(Collector<T> output) throws Exception
output - output collector.Exception - if error occurs.List<SplitT> snapshotState(long checkpointId) throws Exception
If the source is bounded, checkpoint is not triggered.
checkpointId - checkpoint Id.Exception - if error occurs.void addSplits(List<SplitT> splits)
splits - split checkpoint state.void handleNoMoreSplits()
It is triggered when the enumerator calls SourceSplitEnumerator.Context.signalNoMoreSplits(int) with the reader's parallel subtask.
default void handleSourceEvent(SourceEvent sourceEvent)
SourceSplitEnumerator.sourceEvent - source event.Copyright © 2024 The Apache Software Foundation. All rights reserved.