kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject svn commit: r1410649 - /incubator/kafka/branches/0.8/core/src/main/scala/kafka/tools/DumpLogSegments.scala
Date Sat, 17 Nov 2012 00:28:39 GMT
Author: junrao
Date: Sat Nov 17 00:28:38 2012
New Revision: 1410649

URL: http://svn.apache.org/viewvc?rev=1410649&view=rev
Log:
DumpLogSegment offset verification is incorrect for compressed messages; patched by Yang Ye;
reviewed by Jun Rao; KAFKA-614

Modified:
    incubator/kafka/branches/0.8/core/src/main/scala/kafka/tools/DumpLogSegments.scala

Modified: incubator/kafka/branches/0.8/core/src/main/scala/kafka/tools/DumpLogSegments.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/branches/0.8/core/src/main/scala/kafka/tools/DumpLogSegments.scala?rev=1410649&r1=1410648&r2=1410649&view=diff
==============================================================================
--- incubator/kafka/branches/0.8/core/src/main/scala/kafka/tools/DumpLogSegments.scala (original)
+++ incubator/kafka/branches/0.8/core/src/main/scala/kafka/tools/DumpLogSegments.scala Sat
Nov 17 00:28:38 2012
@@ -124,7 +124,8 @@ object DumpLogSegments {
 
       if(lastOffset == -1)
         lastOffset = messageAndOffset.offset
-      else if (messageAndOffset.offset != lastOffset +1) {
+      // If it's uncompressed message, its offset must be lastOffset + 1 no matter last message
is compressed or uncompressed
+      else if (msg.compressionCodec == NoCompressionCodec && messageAndOffset.offset
!= lastOffset +1) {
         var nonConsecutivePairsSeq = nonConsecutivePairsForLogFilesMap.getOrElse(file.getName,
List[(Int, Int)]())
         nonConsecutivePairsSeq ::=((lastOffset, messageAndOffset.offset).asInstanceOf[(Int,
Int)])
         nonConsecutivePairsForLogFilesMap.put(file.getName, nonConsecutivePairsSeq)



Mime
View raw message