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

SocketServer.scala refers to Handler-specific variables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • None
    • 0.8.0
    • None
    • None

    Description

      There is meant to be a separation between the socket server and the kafka server. The socket server doesn't know anything about kafka, it is a set of classes that take a request handler implementation, reads requests and writes responses. It is like a 300 line version of netty. Some logging slipped in that is specific to the KafkaHandler implementation. This is a violation of concerns and should be fixed, it is kind of like the map/reduce framework referencing stuff in a particular map/reduce job. If we want to refactor the handlers to better be able to give the name to a particular request that is good, but nothing in kafka.network should depend on anything but kafka.utils. Having worked on projects where we screwed this up i am a little sensitive--the network stuff is complex enough even if we don't mix it in with kafka logic, we want it to be testable on its own.

      Here is the code (beginning on SocketServer.scala, line 267):
      if(requestLogger.isTraceEnabled) {
      requestTypeId match

      { case RequestKeys.Produce => requestLogger.trace("Handling produce request from " + channelFor(key).socket.getRemoteSocketAddress()) case RequestKeys.Fetch => requestLogger.trace("Handling fetch request from " + channelFor(key).socket.getRemoteSocketAddress()) case RequestKeys.MultiFetch => requestLogger.trace("Handling multi-fetch request from " + channelFor(key).socket.getRemoteSocketAddress()) case RequestKeys.MultiProduce => requestLogger.trace("Handling multi-produce request from " + channelFor(key).socket.getRemoteSocketAddress()) case RequestKeys.Offsets => requestLogger.trace("Handling offset request from " + channelFor(key).socket.getRemoteSocketAddress()) case _ => throw new InvalidRequestException("No mapping found for handler id " + requestTypeId) }

      }

      Attachments

        Activity

          People

            junrao Jun Rao
            jkreps Jay Kreps
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: