From e9f4c3ea46bae3d1f43448e38418b68ded723004 Mon Sep 17 00:00:00 2001 From: Peter Veentjer Date: Tue, 19 Jul 2011 16:06:29 +0300 Subject: [PATCH] ticket 974: Fix of the ambiguity problem in the Configuration.scala --- akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala | 1 + akka-actor/src/main/scala/akka/config/Configuration.scala | 3 ++- config/akka-reference.conf | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala index e7234509d7..37545a6181 100644 --- a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala @@ -36,6 +36,7 @@ class ConfigSpec extends WordSpec with MustMatchers { getInt("akka.actor.timeout") must equal(Some(5)) getInt("akka.actor.throughput") must equal(Some(5)) getInt("akka.actor.throughput-deadline-time") must equal(Some(-1)) + getInt("akka.actor.deployment.service-ping.clustered.replication-factor") must equal(Some(3)) getString("akka.cluster.layer") must equal(Some("akka.remote.netty.NettyRemoteSupport")) getInt("akka.cluster.server.port") must equal(Some(2552)) diff --git a/akka-actor/src/main/scala/akka/config/Configuration.scala b/akka-actor/src/main/scala/akka/config/Configuration.scala index a683c14e42..b32c4eeb72 100644 --- a/akka-actor/src/main/scala/akka/config/Configuration.scala +++ b/akka-actor/src/main/scala/akka/config/Configuration.scala @@ -179,8 +179,9 @@ class Configuration(val map: Map[String, Any]) { def getSection(name: String): Option[Configuration] = { val l = name.length + 1 + val pattern = name+"." val m = map.collect { - case (k, v) if k.startsWith(name) && !k.equals("replication-factor") ⇒ (k.substring(l), v) + case (k, v) if k.startsWith(pattern) ⇒ (k.substring(l), v) } if (m.isEmpty) None else Some(new Configuration(m)) diff --git a/config/akka-reference.conf b/config/akka-reference.conf index 028866b37c..218a824220 100644 --- a/config/akka-reference.conf +++ b/config/akka-reference.conf @@ -55,7 +55,7 @@ akka { # available: "host:", "ip:" and "node:" # default is "host:localhost" - replication-factor = 3 # number of actor instances in the cluster + replication-factor = 3 # number of actor instances in the cluster # available: positive integer (0-N) or the string "auto" for auto-scaling # if "auto" is used then 'home' has no meaning # default is '0', meaning no replicas;