Skip to content

ReplicaFetcher

ReplicaFetcher is a thread that ReplicaVerificationTool uses for replica verification.

Creating Instance

ReplicaFetcher takes the following to be created:

  • ReplicaFetcher-[brokerId]
  • Source broker
  • TopicPartitions
  • Topics IDs (Map[String, Uuid])
  • ReplicaBuffer
  • Socket timeout (30000)
  • Socket buffer size (256000)
  • Fetch size
  • Max wait
  • Min bytes
  • doVerification flag
  • Consumer properties
  • Fetcher ID

ReplicaFetcher is created when:

  • ReplicaVerificationTool command-line utility is executed

doVerification

ReplicaFetcher is given doVerification flag when created.

doVerification flag is enabled for a single ReplicaFetcher among the replica fetcher threads.

The flag is used to determine which ReplicaFetcher should perform verification.

doWork

doWork(): Unit

doWork is part of the ShutdownableThread abstraction.


doWork creates a requestMap with TopicPartitions and PartitionDatas.

doWork prints out the following DEBUG message to the logs:

Issuing fetch request

doWork sends a Fetch request (with the requestMap).

With a FetchResponse, doWork addFetchedData (to the ReplicaBuffer that all ReplicaFetchers append fetched data to). Otherwise, doWork...FIXME

doWork decrements the fetcherBarrier latch. If it reaches 0, doWork prints out the following DEBUG message to the logs:

Done fetching

doWork waits for the other fetchers to finish and prints out the following DEBUG message to the logs:

Ready for verification

With the doVerification flag enabled, doWork performs verification.

doWork waits for the verification to be finished and prints out the following DEBUG message to the logs:

Done verification

Verification

doWork...FIXME