format source with scalafmt
This commit is contained in:
parent
0f40491d42
commit
ce404e4f53
1669 changed files with 43208 additions and 35404 deletions
|
|
@ -48,8 +48,10 @@ object ClusterRoundRobinMultiJvmSpec extends MultiNodeConfig {
|
|||
val third = role("third")
|
||||
val fourth = role("fourth")
|
||||
|
||||
commonConfig(debugConfig(on = false).
|
||||
withFallback(ConfigFactory.parseString("""
|
||||
commonConfig(
|
||||
debugConfig(on = false)
|
||||
.withFallback(
|
||||
ConfigFactory.parseString("""
|
||||
akka.actor {
|
||||
allow-java-serialization = off
|
||||
serialize-creators = off
|
||||
|
|
@ -92,8 +94,8 @@ object ClusterRoundRobinMultiJvmSpec extends MultiNodeConfig {
|
|||
}
|
||||
}
|
||||
}
|
||||
""")).
|
||||
withFallback(MultiNodeClusterSpec.clusterConfig))
|
||||
"""))
|
||||
.withFallback(MultiNodeClusterSpec.clusterConfig))
|
||||
|
||||
nodeConfig(first, second)(ConfigFactory.parseString("""akka.cluster.roles =["a", "c"]"""))
|
||||
nodeConfig(third)(ConfigFactory.parseString("""akka.cluster.roles =["b", "c"]"""))
|
||||
|
|
@ -107,17 +109,18 @@ class ClusterRoundRobinMultiJvmNode2 extends ClusterRoundRobinSpec
|
|||
class ClusterRoundRobinMultiJvmNode3 extends ClusterRoundRobinSpec
|
||||
class ClusterRoundRobinMultiJvmNode4 extends ClusterRoundRobinSpec
|
||||
|
||||
abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMultiJvmSpec)
|
||||
with MultiNodeClusterSpec
|
||||
with ImplicitSender with DefaultTimeout {
|
||||
abstract class ClusterRoundRobinSpec
|
||||
extends MultiNodeSpec(ClusterRoundRobinMultiJvmSpec)
|
||||
with MultiNodeClusterSpec
|
||||
with ImplicitSender
|
||||
with DefaultTimeout {
|
||||
import ClusterRoundRobinMultiJvmSpec._
|
||||
|
||||
lazy val router1 = system.actorOf(FromConfig.props(Props[SomeActor]), "router1")
|
||||
lazy val router2 = system.actorOf(
|
||||
ClusterRouterPool(
|
||||
RoundRobinPool(nrOfInstances = 0),
|
||||
ClusterRouterPoolSettings(totalInstances = 3, maxInstancesPerNode = 1, allowLocalRoutees = true)).
|
||||
props(Props[SomeActor]),
|
||||
ClusterRouterPool(RoundRobinPool(nrOfInstances = 0),
|
||||
ClusterRouterPoolSettings(totalInstances = 3, maxInstancesPerNode = 1, allowLocalRoutees = true))
|
||||
.props(Props[SomeActor]),
|
||||
"router2")
|
||||
lazy val router3 = system.actorOf(FromConfig.props(Props[SomeActor]), "router3")
|
||||
lazy val router4 = system.actorOf(FromConfig.props(), "router4")
|
||||
|
|
@ -312,7 +315,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult
|
|||
|
||||
// note that router2 has totalInstances = 3, maxInstancesPerNode = 1
|
||||
val routees = currentRoutees(router2)
|
||||
val routeeAddresses = routees map { case ActorRefRoutee(ref) => fullAddress(ref) }
|
||||
val routeeAddresses = routees.map { case ActorRefRoutee(ref) => fullAddress(ref) }
|
||||
|
||||
routeeAddresses.size should ===(3)
|
||||
replies.values.sum should ===(iterationCount)
|
||||
|
|
@ -326,7 +329,7 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult
|
|||
// myservice is already running
|
||||
|
||||
def routees = currentRoutees(router4)
|
||||
def routeeAddresses = (routees map { case ActorSelectionRoutee(sel) => fullAddress(sel.anchor) }).toSet
|
||||
def routeeAddresses = routees.map { case ActorSelectionRoutee(sel) => fullAddress(sel.anchor) }.toSet
|
||||
|
||||
runOn(first) {
|
||||
// 4 nodes, 2 routees on each node
|
||||
|
|
@ -351,10 +354,10 @@ abstract class ClusterRoundRobinSpec extends MultiNodeSpec(ClusterRoundRobinMult
|
|||
|
||||
runOn(first) {
|
||||
def routees = currentRoutees(router2)
|
||||
def routeeAddresses = (routees map { case ActorRefRoutee(ref) => fullAddress(ref) }).toSet
|
||||
def routeeAddresses = routees.map { case ActorRefRoutee(ref) => fullAddress(ref) }.toSet
|
||||
|
||||
routees foreach { case ActorRefRoutee(ref) => watch(ref) }
|
||||
val notUsedAddress = ((roles map address).toSet diff routeeAddresses).head
|
||||
routees.foreach { case ActorRefRoutee(ref) => watch(ref) }
|
||||
val notUsedAddress = roles.map(address).toSet.diff(routeeAddresses).head
|
||||
val downAddress = routeeAddresses.find(_ != address(first)).get
|
||||
val downRouteeRef = routees.collectFirst {
|
||||
case ActorRefRoutee(ref) if ref.path.address == downAddress => ref
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue