Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12551 Refactor Kafka Log layer
  3. KAFKA-12571

Eliminate LeaderEpochFileCache constructor dependency on LogEndOffset

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • core
    • None

    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

          Activity

            People

              kprakasam Kowshik Prakasam
              kprakasam Kowshik Prakasam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: