kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nehanarkh...@apache.org
Subject kafka git commit: KAFKA-2114 Unable to change min.insync.replicas default; reviewed by Neha
Date Sun, 26 Apr 2015 20:09:09 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 1000bb622 -> ba3e08958


KAFKA-2114 Unable to change min.insync.replicas default; reviewed by Neha


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

Branch: refs/heads/trunk
Commit: ba3e089582d46b0193a734b6d1c5ebdd41da4dcc
Parents: 1000bb6
Author: Gwen Shapira <cshapi@gmail.com>
Authored: Sun Apr 26 13:09:00 2015 -0700
Committer: Neha Narkhede <nehanarkhede@apache.org>
Committed: Sun Apr 26 13:09:09 2015 -0700

----------------------------------------------------------------------
 .../main/scala/kafka/server/KafkaServer.scala   |  1 +
 .../kafka/integration/MinIsrConfigTest.scala    | 37 ++++++++++++++++++++
 2 files changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ba3e0895/core/src/main/scala/kafka/server/KafkaServer.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/KafkaServer.scala b/core/src/main/scala/kafka/server/KafkaServer.scala
index d401bac..b7d2a28 100755
--- a/core/src/main/scala/kafka/server/KafkaServer.scala
+++ b/core/src/main/scala/kafka/server/KafkaServer.scala
@@ -381,6 +381,7 @@ class KafkaServer(val config: KafkaConfig, time: Time = SystemTime) extends
Logg
                                      fileDeleteDelayMs = config.logDeleteDelayMs,
                                      minCleanableRatio = config.logCleanerMinCleanRatio,
                                      compact = config.logCleanupPolicy.trim.toLowerCase ==
"compact",
+                                     minInSyncReplicas = config.minInSyncReplicas,
                                      compressionType = config.compressionType)
     val defaultProps = defaultLogConfig.toProps
     val configs = AdminUtils.fetchAllTopicConfigs(zkClient).mapValues(LogConfig.fromProps(defaultProps,
_))

http://git-wip-us.apache.org/repos/asf/kafka/blob/ba3e0895/core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala b/core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala
new file mode 100644
index 0000000..70a5b3a
--- /dev/null
+++ b/core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package unit.kafka.integration
+
+import java.util.Properties
+
+import kafka.integration.KafkaServerTestHarness
+import kafka.server.KafkaConfig
+import kafka.utils.TestUtils
+import org.scalatest.junit.JUnit3Suite
+
+class MinIsrConfigTest extends JUnit3Suite with KafkaServerTestHarness {
+
+  val overridingProps = new Properties()
+  overridingProps.put(KafkaConfig.MinInSyncReplicasProp, "5")
+  def generateConfigs() = TestUtils.createBrokerConfigs(1, zkConnect).map(KafkaConfig.fromProps(_,
overridingProps))
+
+  def testDefaultKafkaConfig() {
+    assert(servers.head.getLogManager().defaultConfig.minInSyncReplicas == 5)
+  }
+
+}


Mime
View raw message