AbstractFetcherManager

AbstractFetcherManager is the abstraction of fetcher thread managers that can create a fetcher thread (for ReplicaManager).

Note
AbstractFetcherManager is a Java abstract class and cannot be created directly. It is created indirectly for the concrete AbstractFetcherManagers.
Table 1. AbstractFetcherManager Contract (Abstract Methods)
Method Description

createFetcherThread

createFetcherThread(fetcherId: Int, sourceBroker: BrokerEndPoint): T

Used when AbstractFetcherManager is requested to addFetcherForPartitions

Table 2. AbstractFetcherManagers
AbstractFetcherManager Description

ReplicaAlterLogDirsManager

ReplicaFetcherManager

Table 3. AbstractFetcherManager’s Internal Properties (e.g. Registries, Counters and Flags)
Name Description

numFetchersPerBroker

Number of fetcher threads per broker

Initialized with the given numFetchers

Resized in resizeThreadPool

Used exclusively in getFetcherId

addFetcherForPartitions Method

addFetcherForPartitions(
  partitionAndOffsets: Map[TopicPartition, InitialFetchState]): Unit

addFetcherForPartitions…​FIXME

Note

addFetcherForPartitions is used when:

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.

Hashing Topic and Partition — 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 getFetcher, 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

removeFetcherForPartitions is used when:

results matching ""

    No results matching ""