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)
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, maybeShutdownFinishedFetchers, startFetcher
public SingleThreadFetcherManager(FutureCompletingBlockingQueue<RecordsWithSplitIds<E>> elementsQueue, java.util.function.Supplier<SplitReader<E,SplitT>> splitReaderSupplier)
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 void addSplits(List<SplitT> splitsToAdd)
addSplits
in class SplitFetcherManager<E,SplitT extends SourceSplit>
protected SplitFetcher<E,SplitT> getRunningFetcher()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.