Repository: kafka
Updated Branches:
  refs/heads/trunk ae9532c6b -> 704308a63


KAFKA-4289; moved short-lived loggers to companion objects

Signed-off-by: radai-rosenblatt <radai.rosenblattgmail.com>

Author: radai-rosenblatt <radai.rosenbl...@gmail.com>

Reviewers: Jiangjie Qin <becket....@gmail.com>, Onur Karaman 
<okara...@linkedin.com>, Joel Koshy <jjkosh...@gmail.com>

Closes #2006 from radai-rosenblatt/omgsrsly


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

Branch: refs/heads/trunk
Commit: 704308a6352461f09ac5adc37028b6c7b9f4f83f
Parents: ae9532c
Author: Radai Rosenblatt <radai.rosenbl...@gmail.com>
Authored: Wed Oct 12 12:55:44 2016 +0100
Committer: Ismael Juma <ism...@juma.me.uk>
Committed: Wed Oct 12 12:55:44 2016 +0100

----------------------------------------------------------------------
 core/src/main/scala/kafka/log/FileMessageSet.scala     | 9 ++++++---
 core/src/main/scala/kafka/network/RequestChannel.scala | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/704308a6/core/src/main/scala/kafka/log/FileMessageSet.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/log/FileMessageSet.scala 
b/core/src/main/scala/kafka/log/FileMessageSet.scala
index 551fa6d..fd9ec5f 100755
--- a/core/src/main/scala/kafka/log/FileMessageSet.scala
+++ b/core/src/main/scala/kafka/log/FileMessageSet.scala
@@ -47,8 +47,8 @@ class FileMessageSet private[kafka](@volatile var file: File,
                                     private[log] val channel: FileChannel,
                                     private[log] val start: Int,
                                     private[log] val end: Int,
-                                    isSlice: Boolean) extends MessageSet with 
Logging {
-
+                                    isSlice: Boolean) extends MessageSet {
+  import FileMessageSet._
   /* the size of the message set in bytes */
   private val _size =
     if(isSlice)
@@ -430,8 +430,11 @@ class FileMessageSet private[kafka](@volatile var file: 
File,
 
 }
 
-object FileMessageSet
+object FileMessageSet extends Logging
 {
+  //preserve the previous logger name after moving logger aspect from 
FileMessageSet to companion
+  override val loggerName = classOf[FileMessageSet].getName
+
   /**
    * Open a channel for the given file
    * For windows NTFS and some old LINUX file system, set preallocate to true 
and initFileSize

http://git-wip-us.apache.org/repos/asf/kafka/blob/704308a6/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 8aec2d2..dace782 100644
--- a/core/src/main/scala/kafka/network/RequestChannel.scala
+++ b/core/src/main/scala/kafka/network/RequestChannel.scala
@@ -38,6 +38,7 @@ import org.apache.log4j.Logger
 
 object RequestChannel extends Logging {
   val AllDone = new Request(processor = 1, connectionId = "2", new 
Session(KafkaPrincipal.ANONYMOUS, InetAddress.getLocalHost()), buffer = 
getShutdownReceive(), startTimeMs = 0, securityProtocol = 
SecurityProtocol.PLAINTEXT)
+  private val requestLogger = Logger.getLogger("kafka.request.logger")
 
   def getShutdownReceive() = {
     val emptyRequestHeader = new RequestHeader(ApiKeys.PRODUCE.id, "", 0)
@@ -102,7 +103,6 @@ object RequestChannel extends Logging {
         null
 
     buffer = null
-    private val requestLogger = Logger.getLogger("kafka.request.logger")
 
     def requestDesc(details: Boolean): String = {
       if (requestObj != null)

Reply via email to