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/01 05:27:47 UTC

git commit: KAFKA-1107 Follow up review cleanup comments

Updated Branches:
  refs/heads/trunk ec547737d -> a4fafefdb


KAFKA-1107 Follow up review cleanup comments


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

Branch: refs/heads/trunk
Commit: a4fafefdb3a2701d30f14feed3be11f1c0905c31
Parents: ec54773
Author: Neha Narkhede <ne...@gmail.com>
Authored: Thu Oct 31 21:27:38 2013 -0700
Committer: Neha Narkhede <ne...@gmail.com>
Committed: Thu Oct 31 21:27:38 2013 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/log/Log.scala          | 3 +--
 core/src/test/scala/unit/kafka/log/LogTest.scala | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/a4fafefd/core/src/main/scala/kafka/log/Log.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/log/Log.scala b/core/src/main/scala/kafka/log/Log.scala
index a0e1b11..9205128 100644
--- a/core/src/main/scala/kafka/log/Log.scala
+++ b/core/src/main/scala/kafka/log/Log.scala
@@ -165,8 +165,7 @@ class Log(val dir: File,
   
   private def recoverLog() {
     val lastOffset = try {activeSegment.nextOffset} catch {case _: Throwable => -1L}
-    val cleanShutdownFile = new File(dir.getParentFile, CleanShutdownFile)
-    val needsRecovery = !cleanShutdownFile.exists()
+    val needsRecovery = !(new File(dir.getParentFile, CleanShutdownFile)).exists()
     if(!needsRecovery) {
       this.recoveryPoint = lastOffset
       return

http://git-wip-us.apache.org/repos/asf/kafka/blob/a4fafefd/core/src/test/scala/unit/kafka/log/LogTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/log/LogTest.scala b/core/src/test/scala/unit/kafka/log/LogTest.scala
index 0b516f9..1571f1e 100644
--- a/core/src/test/scala/unit/kafka/log/LogTest.scala
+++ b/core/src/test/scala/unit/kafka/log/LogTest.scala
@@ -628,7 +628,7 @@ class LogTest extends JUnitSuite {
     val cleanShutdownFile = new File(parentLogDir, Log.CleanShutdownFile)
     cleanShutdownFile.createNewFile()
     assertTrue(".kafka_cleanshutdown must exist", cleanShutdownFile.exists())
-    var recoveryPoint = 50L
+    var recoveryPoint = 0L
     // create a log and write some messages to it
     var log = new Log(logDir,
       config,