kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-1896; Record size function should check if value is null; reviewed by Guozhang Wang
Date Sat, 24 Jan 2015 02:23:42 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 8cff9119f -> ff5cbcacc


KAFKA-1896; Record size function should check if value is null; reviewed by Guozhang Wang


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

Branch: refs/heads/trunk
Commit: ff5cbcacc6fc3217ea41c624fb293adeae7bb672
Parents: 8cff911
Author: Jiangjie Qin <becket.qin@gmail.com>
Authored: Fri Jan 23 18:23:32 2015 -0800
Committer: Guozhang Wang <guwang@linkedin.com>
Committed: Fri Jan 23 18:23:32 2015 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/MirrorMaker.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ff5cbcac/core/src/main/scala/kafka/tools/MirrorMaker.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/MirrorMaker.scala b/core/src/main/scala/kafka/tools/MirrorMaker.scala
index 3ee84ed..81ae205 100644
--- a/core/src/main/scala/kafka/tools/MirrorMaker.scala
+++ b/core/src/main/scala/kafka/tools/MirrorMaker.scala
@@ -637,7 +637,7 @@ object MirrorMaker extends Logging with KafkaMetricsGroup {
                                           val sourceOffset: Long,
                                           val key: Array[Byte],
                                           val value: Array[Byte]) {
-    def size = value.length + {if (key == null) 0 else key.length}
+    def size = {if (value == null) 0 else value.length} + {if (key == null) 0 else key.length}
   }
 
   private class UnackedOffset(offset: Long) extends DoublyLinkedListNode[Long](offset) {


Mime
View raw message