Class SingleThreadFetcherManager<E,SplitT extends org.apache.flink.api.connector.source.SourceSplit>
java.lang.Object
org.apache.flink.connector.base.source.reader.fetcher.SplitFetcherManager<E,SplitT>
org.apache.flink.connector.base.source.reader.fetcher.SingleThreadFetcherManager<E,SplitT>
@PublicEvolving
public class SingleThreadFetcherManager<E,SplitT extends org.apache.flink.api.connector.source.SourceSplit>
extends SplitFetcherManager<E,SplitT>
A Fetcher Manager with a single fetching thread (I/O thread) that handles all splits
concurrently.
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.
-
Field Summary
Fields inherited from class org.apache.flink.connector.base.source.reader.fetcher.SplitFetcherManager
fetchers -
Constructor Summary
ConstructorsConstructorDescriptionSingleThreadFetcherManager(Supplier<SplitReader<E, SplitT>> splitReaderSupplier) Creates a new SplitFetcherManager with a single I/O threads.SingleThreadFetcherManager(Supplier<SplitReader<E, SplitT>> splitReaderSupplier, org.apache.flink.configuration.Configuration configuration) Creates a new SplitFetcherManager with a single I/O threads.SingleThreadFetcherManager(Supplier<SplitReader<E, SplitT>> splitReaderSupplier, org.apache.flink.configuration.Configuration configuration, Consumer<Collection<String>> splitFinishedHook) Creates a new SplitFetcherManager with a single I/O threads. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected SplitFetcher<E,SplitT> voidremoveSplits(List<SplitT> splitsToRemove) Methods inherited from class org.apache.flink.connector.base.source.reader.fetcher.SplitFetcherManager
checkErrors, close, createSplitFetcher, getNumAliveFetchers, getQueue, maybeShutdownFinishedFetchers, pauseOrResumeSplits, startFetcher
-
Constructor Details
-
SingleThreadFetcherManager
Creates a new SplitFetcherManager with a single I/O threads.- Parameters:
splitReaderSupplier- The factory for the split reader that connects to the source system.
-
SingleThreadFetcherManager
public SingleThreadFetcherManager(Supplier<SplitReader<E, SplitT>> splitReaderSupplier, org.apache.flink.configuration.Configuration configuration) Creates a new SplitFetcherManager with a single I/O threads.- Parameters:
splitReaderSupplier- The factory for the split reader that connects to the source system.configuration- The configuration to create the fetcher manager.
-
SingleThreadFetcherManager
public SingleThreadFetcherManager(Supplier<SplitReader<E, SplitT>> splitReaderSupplier, org.apache.flink.configuration.Configuration configuration, Consumer<Collection<String>> splitFinishedHook) Creates a new SplitFetcherManager with a single I/O threads.- Parameters:
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 fetchers
-
-
Method Details
-
addSplits
- Specified by:
addSplitsin classSplitFetcherManager<E,SplitT extends org.apache.flink.api.connector.source.SourceSplit>
-
removeSplits
- Specified by:
removeSplitsin classSplitFetcherManager<E,SplitT extends org.apache.flink.api.connector.source.SourceSplit>
-
getRunningFetcher
-