You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ne...@apache.org on 2013/11/06 03:14:13 UTC

git commit: KAFKA-1121 DumpLogSegments tool should print absolute file name to report inconsistencies; reviewed by Neha Narkhede and Guozhang Wang

Updated Branches:
  refs/heads/trunk 7d1ac1d80 -> 986161886


KAFKA-1121 DumpLogSegments tool should print absolute file name to report inconsistencies; reviewed by Neha Narkhede and Guozhang Wang


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

Branch: refs/heads/trunk
Commit: 98616188645d1d57e98a6b92f615345fc7653d9d
Parents: 7d1ac1d
Author: Swapnil Ghike <sg...@linkedin.com>
Authored: Tue Nov 5 18:13:58 2013 -0800
Committer: Neha Narkhede <ne...@gmail.com>
Committed: Tue Nov 5 18:14:08 2013 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/DumpLogSegments.scala | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/98616188/core/src/main/scala/kafka/tools/DumpLogSegments.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/DumpLogSegments.scala b/core/src/main/scala/kafka/tools/DumpLogSegments.scala
index 89b6cb1..14f44d9 100644
--- a/core/src/main/scala/kafka/tools/DumpLogSegments.scala
+++ b/core/src/main/scala/kafka/tools/DumpLogSegments.scala
@@ -77,9 +77,9 @@ object DumpLogSegments {
       }
     }
     nonConsecutivePairsForLogFilesMap.foreach {
-      case (fileName, listOfNonSecutivePairs) => {
+      case (fileName, listOfNonConsecutivePairs) => {
         System.err.println("Non-secutive offsets in :" + fileName)
-        listOfNonSecutivePairs.foreach(m => {
+        listOfNonConsecutivePairs.foreach(m => {
           System.err.println("  %d is followed by %d".format(m._1, m._2))
         })
       }
@@ -101,9 +101,9 @@ object DumpLogSegments {
       val partialFileMessageSet: FileMessageSet = messageSet.read(entry.position, maxMessageSize)
       val messageAndOffset = getIterator(partialFileMessageSet.head, isDeepIteration = true).next()
       if(messageAndOffset.offset != entry.offset + index.baseOffset) {
-        var misMatchesSeq = misMatchesForIndexFilesMap.getOrElse(file.getName, List[(Long, Long)]())
+        var misMatchesSeq = misMatchesForIndexFilesMap.getOrElse(file.getAbsolutePath, List[(Long, Long)]())
         misMatchesSeq ::=(entry.offset + index.baseOffset, messageAndOffset.offset)
-        misMatchesForIndexFilesMap.put(file.getName, misMatchesSeq)
+        misMatchesForIndexFilesMap.put(file.getAbsolutePath, misMatchesSeq)
       }
       // since it is a sparse file, in the event of a crash there may be many zero entries, stop if we see one
       if(entry.offset == 0 && i > 0)
@@ -132,9 +132,9 @@ object DumpLogSegments {
           lastOffset = messageAndOffset.offset
         // If we are iterating uncompressed messages, offsets must be consecutive
         else if (msg.compressionCodec == NoCompressionCodec && messageAndOffset.offset != lastOffset +1) {
-          var nonConsecutivePairsSeq = nonConsecutivePairsForLogFilesMap.getOrElse(file.getName, List[(Long, Long)]())
+          var nonConsecutivePairsSeq = nonConsecutivePairsForLogFilesMap.getOrElse(file.getAbsolutePath, List[(Long, Long)]())
           nonConsecutivePairsSeq ::=(lastOffset, messageAndOffset.offset)
-          nonConsecutivePairsForLogFilesMap.put(file.getName, nonConsecutivePairsSeq)
+          nonConsecutivePairsForLogFilesMap.put(file.getAbsolutePath, nonConsecutivePairsSeq)
         }
         lastOffset = messageAndOffset.offset