createFetcherThread(
fetcherId: Int,
sourceBroker: BrokerEndPoint): T
AbstractFetcherManager
AbstractFetcherManager is the abstraction of fetcher thread managers that can create fetcher threads (for ReplicaManager).
|
Note
|
AbstractFetcherManager is an abstract class and cannot be created directly. It is created indirectly for the concrete AbstractFetcherManagers.
|
| Method | Description |
|---|---|
|
Creates a fetcher thread Used when |
| AbstractFetcherManager | Description |
|---|---|
Performance Metrics
AbstractFetcherManagers are KafkaMetricsGroups with the following performance metrics.
| Metric Name | Description |
|---|---|
|
|
|
|
|
|
|
The performance metrics are registered in kafka.server:type= group with the type being the name of a AbstractFetcherManager.
Creating AbstractFetcherManager Instance
AbstractFetcherManager takes the following to be created:
-
Client ID (for a tag in performance metrics)
AbstractFetcherManager initializes the internal properties.
addFetcherForPartitions Method
addFetcherForPartitions(
partitionAndOffsets: Map[TopicPartition, InitialFetchState]): Unit
addFetcherForPartitions…FIXME
|
Note
|
|
resizeThreadPool Method
resizeThreadPool(newSize: Int): Unit
resizeThreadPool prints out the following INFO message to the logs:
Resizing fetcher thread pool size from [currentSize] to [newSize]
resizeThreadPool…FIXME
|
Note
|
resizeThreadPool is used exclusively when DynamicThreadPool is requested to reconfigure.
|
Finding Fetcher Thread ID — getFetcherId Method
getFetcherId(
topicPartition: TopicPartition): Int
getFetcherId calculates a hash of the topic and partition (from the given TopicPartition) modulo (%) the numFetchersPerBroker.
|
Note
|
getFetcherId is used when AbstractFetcherManager is requested to markPartitionsForTruncation and addFetcherForPartitions.
|
getFetcher Method
getFetcher(topicPartition: TopicPartition): Option[T]
getFetcher…FIXME
|
Note
|
getFetcher is used when…FIXME
|
markPartitionsForTruncation Method
markPartitionsForTruncation(
brokerId: Int,
topicPartition: TopicPartition,
truncationOffset: Long): Unit
markPartitionsForTruncation…FIXME
|
Note
|
markPartitionsForTruncation is used when…FIXME
|
removeFetcherForPartitions Method
removeFetcherForPartitions(
partitions: Set[TopicPartition]): Unit
removeFetcherForPartitions…FIXME
|
Note
|
|
closeAllFetchers Method
closeAllFetchers(): Unit
closeAllFetchers requests the fetcher threads to initiateShutdown.
closeAllFetchers requests the fetcher threads to shutdown.
In the end, closeAllFetchers removes (clears) all entries from the fetcherThreadMap internal registry.
|
Note
|
closeAllFetchers is used when ReplicaAlterLogDirsManager and ReplicaFetcherManager are requested to shut down.
|
Internal Properties
| Name | Description |
|---|---|
|
AbstractFetcherThreads by (a pair of) broker ID and fetcher ID |
|
Initialized with the given numFetchers when Resized in resizeThreadPool Used in getFetcherId |