kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject kafka git commit: kafka-1803; UncleanLeaderElectionEnableProp in LogConfig should be of boolean; patched by Dave Parfitt; reviewed by Jun Rao
Date Wed, 03 Dec 2014 01:53:27 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 15f9e2762 -> 7e9368baf


kafka-1803; UncleanLeaderElectionEnableProp in LogConfig should be of boolean; patched by
Dave Parfitt; reviewed by Jun Rao


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

Branch: refs/heads/trunk
Commit: 7e9368baf2e1cd457293b815a665e5d3e4418dfb
Parents: 15f9e27
Author: Dave Parfitt <diparfitt@gmail.com>
Authored: Tue Dec 2 17:53:21 2014 -0800
Committer: Jun Rao <junrao@gmail.com>
Committed: Tue Dec 2 17:53:21 2014 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/log/LogConfig.scala | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/7e9368ba/core/src/main/scala/kafka/log/LogConfig.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/log/LogConfig.scala b/core/src/main/scala/kafka/log/LogConfig.scala
index f2fbc55..ca7a99e 100644
--- a/core/src/main/scala/kafka/log/LogConfig.scala
+++ b/core/src/main/scala/kafka/log/LogConfig.scala
@@ -171,9 +171,8 @@ object LogConfig {
         MinCleanableRatioDoc)
       .define(CleanupPolicyProp, STRING, if (Defaults.Compact) Compact else Delete, in(asList(Compact,
Delete)), MEDIUM,
         CompactDoc)
-      // we validate true/false explicitly to fail in case of typo
-      .define(UncleanLeaderElectionEnableProp, STRING, Defaults.UncleanLeaderElectionEnable.toString,
-        in(asList(true.toString, false.toString)), MEDIUM, UncleanLeaderElectionEnableDoc)
+      .define(UncleanLeaderElectionEnableProp, BOOLEAN, Defaults.UncleanLeaderElectionEnable,
+        MEDIUM, UncleanLeaderElectionEnableDoc)
       .define(MinInSyncReplicasProp, INT, Defaults.MinInSyncReplicas, atLeast(1), MEDIUM,
MinInSyncReplicasDoc)
   }
 
@@ -202,7 +201,7 @@ object LogConfig {
                   deleteRetentionMs = parsed.get(DeleteRetentionMsProp).asInstanceOf[Long],
                   minCleanableRatio = parsed.get(MinCleanableDirtyRatioProp).asInstanceOf[Double],
                   compact = parsed.get(CleanupPolicyProp).asInstanceOf[String].toLowerCase
!= Delete,
-                  uncleanLeaderElectionEnable = parsed.get(UncleanLeaderElectionEnableProp).asInstanceOf[String].toBoolean,
+                  uncleanLeaderElectionEnable = parsed.get(UncleanLeaderElectionEnableProp).asInstanceOf[Boolean],
                   minInSyncReplicas = parsed.get(MinInSyncReplicasProp).asInstanceOf[Int])
   }
 


Mime
View raw message