kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nehanarkh...@apache.org
Subject git commit: KAFKA-1732 DumpLogSegments tool fails when path has a '.'; reviewed by Neha Narkhede
Date Mon, 27 Oct 2014 23:23:46 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 43cb192b5 -> 20f5b01fe


KAFKA-1732 DumpLogSegments tool fails when path has a '.'; reviewed by Neha Narkhede


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

Branch: refs/heads/trunk
Commit: 20f5b01feacd1e95d558073b7be511cb82888b3e
Parents: 43cb192
Author: Ewen Cheslack-Postava <me@ewencp.org>
Authored: Mon Oct 27 16:23:24 2014 -0700
Committer: Neha Narkhede <neha.narkhede@gmail.com>
Committed: Mon Oct 27 16:23:35 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/DumpLogSegments.scala | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/20f5b01f/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 8e9d47b..fe2cc11 100644
--- a/core/src/main/scala/kafka/tools/DumpLogSegments.scala
+++ b/core/src/main/scala/kafka/tools/DumpLogSegments.scala
@@ -104,8 +104,7 @@ object DumpLogSegments {
                         misMatchesForIndexFilesMap: mutable.HashMap[String, List[(Long, Long)]],
                         maxMessageSize: Int) {
     val startOffset = file.getName().split("\\.")(0).toLong
-    val logFileName = file.getAbsolutePath.split("\\.")(0) + Log.LogFileSuffix
-    val logFile = new File(logFileName)
+    val logFile = new File(file.getAbsoluteFile.getParent, file.getName.split("\\.")(0) +
Log.LogFileSuffix)
     val messageSet = new FileMessageSet(logFile, false)
     val index = new OffsetIndex(file = file, baseOffset = startOffset)
     for(i <- 0 until index.entries) {


Mime
View raw message