kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Fix tracing in KafkaApis.handle()
Date Fri, 27 May 2016 20:35:12 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk f79db1a42 -> 936e26aa8


MINOR: Fix tracing in KafkaApis.handle()

requestObj() returns null for the o.a.k.c.requests objects so use header() for these.

Once all the requests will have been replaced by o.a.k.c.requests objects, we should be able
to clean that up, but in the meantime it's useful to trace both.

Author: Mickael Maison <mickael.maison@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #1435 from mimaison/kafkaapis_trace


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/936e26aa
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/936e26aa
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/936e26aa

Branch: refs/heads/trunk
Commit: 936e26aa8db991b51141b21df234d702bc05408f
Parents: f79db1a
Author: Mickael Maison <mickael.maison@gmail.com>
Authored: Fri May 27 21:35:08 2016 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Fri May 27 21:35:08 2016 +0100

----------------------------------------------------------------------
 core/src/main/scala/kafka/network/RequestChannel.scala | 2 +-
 core/src/main/scala/kafka/server/KafkaApis.scala       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/936e26aa/core/src/main/scala/kafka/network/RequestChannel.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/network/RequestChannel.scala b/core/src/main/scala/kafka/network/RequestChannel.scala
index e2000db..53a2346 100644
--- a/core/src/main/scala/kafka/network/RequestChannel.scala
+++ b/core/src/main/scala/kafka/network/RequestChannel.scala
@@ -100,7 +100,7 @@ object RequestChannel extends Logging {
     buffer = null
     private val requestLogger = Logger.getLogger("kafka.request.logger")
 
-    private def requestDesc(details: Boolean): String = {
+    def requestDesc(details: Boolean): String = {
       if (requestObj != null)
         requestObj.describe(details)
       else

http://git-wip-us.apache.org/repos/asf/kafka/blob/936e26aa/core/src/main/scala/kafka/server/KafkaApis.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/KafkaApis.scala b/core/src/main/scala/kafka/server/KafkaApis.scala
index 086bd4b..1edc162 100644
--- a/core/src/main/scala/kafka/server/KafkaApis.scala
+++ b/core/src/main/scala/kafka/server/KafkaApis.scala
@@ -71,7 +71,7 @@ class KafkaApis(val requestChannel: RequestChannel,
   def handle(request: RequestChannel.Request) {
     try {
       trace("Handling request:%s from connection %s;securityProtocol:%s,principal:%s".
-        format(request.requestObj, request.connectionId, request.securityProtocol, request.session.principal))
+        format(request.requestDesc(true), request.connectionId, request.securityProtocol,
request.session.principal))
       ApiKeys.forId(request.requestId) match {
         case ApiKeys.PRODUCE => handleProducerRequest(request)
         case ApiKeys.FETCH => handleFetchRequest(request)


Mime
View raw message