E - the element type.SplitT - the split type.@PublicEvolving
public interface SplitReader<E,SplitT extends org.apache.flink.api.connector.source.SourceSplit>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close the split reader.
|
RecordsWithSplitIds<E> |
fetch()
Fetch elements into the blocking queue for the given splits.
|
void |
handleSplitsChanges(SplitsChange<SplitT> splitsChanges)
Handle the split changes.
|
void |
wakeUp()
Wake up the split reader in case the fetcher thread is blocking in
fetch(). |
RecordsWithSplitIds<E> fetch() throws IOException
wakeUp() is invoked. In that case, the
implementation may either decide to return without throwing an exception, or it can just
throw an interrupted exception. In either case, this method should be reentrant, meaning that
the next fetch call should just resume from where the last fetch call was waken up or
interrupted.IOException - when encountered IO errors, such as deserialization failures.void handleSplitsChanges(SplitsChange<SplitT> splitsChanges)
For the consistency of internal state in SourceReaderBase, if an invalid split is added to
the reader (for example splits without any records), it should be put back into RecordsWithSplitIds as finished splits so that SourceReaderBase could be able to clean up
resources created for it.
splitsChanges - the split changes that the SplitReader needs to handle.void wakeUp()
fetch().Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.