@Internal public class SingleThreadFetcherManager<E,SplitT extends org.apache.flink.api.connector.source.SourceSplit> extends SplitFetcherManager<E,SplitT>
This pattern is, for example, useful for connectors like File Readers, Apache Kafka Readers, etc. In the example of Kafka, there is a single thread that reads all splits (topic partitions) via the same client. In the example of the file source, there is a single thread that reads the files after another.
fetchers| 构造器和说明 |
|---|
SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue,
java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier)
已过时。
|
SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue,
java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier,
org.apache.flink.configuration.Configuration configuration)
Creates a new SplitFetcherManager with a single I/O threads.
|
SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue,
java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier,
org.apache.flink.configuration.Configuration configuration,
java.util.function.Consumer<Collection<String>> splitFinishedHook)
Creates a new SplitFetcherManager with a single I/O threads.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addSplits(List<SplitT> splitsToAdd) |
protected SplitFetcher<E,SplitT> |
getRunningFetcher() |
checkErrors, close, createSplitFetcher, getNumAliveFetchers, maybeShutdownFinishedFetchers, pauseOrResumeSplits, startFetcher@Deprecated public SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue, java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier)
SingleThreadFetcherManager(FutureCompletingBlockingQueue,
Supplier, Configuration) instead.elementsQueue - The queue that is used to hand over data from the I/O thread (the
fetchers) to the reader (which emits the records and book-keeps the state. This must be
the same queue instance that is also passed to the SourceReaderBase.splitReaderSupplier - The factory for the split reader that connects to the source
system.public SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue, java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier, org.apache.flink.configuration.Configuration configuration)
elementsQueue - The queue that is used to hand over data from the I/O thread (the
fetchers) to the reader (which emits the records and book-keeps the state. This must be
the same queue instance that is also passed to the SourceReaderBase.splitReaderSupplier - The factory for the split reader that connects to the source
system.configuration - The configuration to create the fetcher manager.@VisibleForTesting public SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue, java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier, org.apache.flink.configuration.Configuration configuration, java.util.function.Consumer<Collection<String>> splitFinishedHook)
elementsQueue - The queue that is used to hand over data from the I/O thread (the
fetchers) to the reader (which emits the records and book-keeps the state. This must be
the same queue instance that is also passed to the SourceReaderBase.splitReaderSupplier - The factory for the split reader that connects to the source
system.configuration - The configuration to create the fetcher manager.splitFinishedHook - Hook for handling finished splits in split fetcherspublic void addSplits(List<SplitT> splitsToAdd)
addSplits 在类中 SplitFetcherManager<E,SplitT extends org.apache.flink.api.connector.source.SourceSplit>protected SplitFetcher<E,SplitT> getRunningFetcher()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.