Description
This is a precursor to KAFKA-12553.
Before refactoring the recovery logic (KAFKA-12553), we would like to move the logic to initialize LeaderEpochFileCache outside the Log class. Once we suitably initialize LeaderEpochFileCache outside Log, we will be able pass it as a dependency into both the Log class constructor and the recovery module. However, the LeaderEpochFileCache constructor takes a dependency on logEndOffset (via a callback). This dependency prevents the instantiation of LeaderEpochFileCache outside Log class.
This situation blocks the recovery logic (KAFKA-12553) refactor. So this constructor dependency on logEndOffset needs to be eliminated.
It turns out the logEndOffset dependency is used only in 1 of the LeaderEpochFileCache methods: LeaderEpochFileCache.endOffsetFor, and just for 1 particular case. Therefore, it should be possible to modify this so that we only pass the logEndOffset as a parameter into endOffsetFor whenever the method is called.
Attachments
Issue Links
- links to