Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-521

Refactor Log subsystem

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      There are a number of items it would be nice to cleanup in the log subsystem:
      1. Misc. funky apis in Log and LogManager
      2. Much of the functionality in Log should move into LogSegment along with corresponding tests
      3. We should remove SegmentList and instead use a ConcurrentSkipListMap

      The general idea of the refactoring fall into two categories. First, improve and thoroughly document the public APIs. Second, have a clear delineation of responsibility between the various layers:
      1. LogManager is responsible for the creation and deletion of logs as well as the retention of data in log segments. LogManager is the only layer aware of partitions and topics. LogManager consists of a bunch of individual Log instances and interacts with them only through their public API (mostly true today).
      2. Log represents a totally ordered log. Log is responsible for reading, appending, and truncating the log. A log consists of a bunch of LogSegments. Currently much of the functionality in Log should move into LogSegment with Log interacting only through the Log interface. Currently we reach around this a lot to call into FileMessageSet and OffsetIndex.
      3. A LogSegment consists of an OffsetIndex and a FileMessageSet. It supports largely the same APIs as Log, but now localized to a single segment.

      This cleanup will simplify testing and debugging because it will make the responsibilities and guarantees at each layer more clear.

      Attachments

        1. KAFKA-521-v5.patch
          155 kB
          Jay Kreps
        2. KAFKA-521-v4.patch
          141 kB
          Jay Kreps
        3. KAFKA-521-v3.patch
          140 kB
          Jay Kreps
        4. KAFKA-521-v2.patch
          137 kB
          Jay Kreps
        5. KAFKA-521-v1.patch
          126 kB
          Jay Kreps

        Activity

          People

            jkreps Jay Kreps
            jkreps Jay Kreps
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: