@Internal public class SingleThreadFetcherManager<E,SplitT extends 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
Constructor and Description |
---|
SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue,
java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier)
Deprecated.
|
SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue,
java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier,
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,
Configuration configuration,
java.util.function.Consumer<Collection<String>> splitFinishedHook)
Creates a new SplitFetcherManager with a single I/O threads.
|
Modifier and Type | Method and Description |
---|---|
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, 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, 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
in class SplitFetcherManager<E,SplitT extends SourceSplit>
protected SplitFetcher<E,SplitT> getRunningFetcher()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.