Kafka
  1. Kafka
  2. KAFKA-169

Layering violations in Kafka code

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      I am noticing lot of layering violations creeping into the code.

      For example the log implementation depends on zookeeper code now, the network server depends on the kafka api, etc. This stuff is messy and makes it hard to test or reason about the pieces in isolation.

      I have run a quick analysis on the imports to look at problems and there are a few. Let's try to keep this graph in good shape and think about the layering in the code.

      1. draw_deps.py
        0.7 kB
        Jay Kreps
      2. kafka_deps.svg
        19 kB
        Jay Kreps

        Activity

        Hide
        Jay Kreps added a comment -

        Here is a script to create a graphviz graph of the package dependencies. I also attached the output graph in svg form. This graph is slightly filtered (I removed things like utils and javaapi which are natural integration points).

        Here is the command I used to generate this:
        cd kafka-trunk/core/src/main/scala
        egrep -R '(import|package)' . | python ~/Desktop/draw_deps.py kafka | grep -v javaapi | grep -v utils | grep -v kafka.tools > ~/Desktop/kafka_deps.dot; dot -o ~/Desktop/kafka_deps.svg -Tsvg ~/Desktop/kafka_deps.dot

        Show
        Jay Kreps added a comment - Here is a script to create a graphviz graph of the package dependencies. I also attached the output graph in svg form. This graph is slightly filtered (I removed things like utils and javaapi which are natural integration points). Here is the command I used to generate this: cd kafka-trunk/core/src/main/scala egrep -R '(import|package)' . | python ~/Desktop/draw_deps.py kafka | grep -v javaapi | grep -v utils | grep -v kafka.tools > ~/Desktop/kafka_deps.dot; dot -o ~/Desktop/kafka_deps.svg -Tsvg ~/Desktop/kafka_deps.dot

          People

          • Assignee:
            Unassigned
            Reporter:
            Jay Kreps
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development