diff --git a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala index d0eb2983c4..f85d3484ff 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala @@ -121,7 +121,6 @@ trait ClusterNodeMBean { */ object Cluster { val EMPTY_STRING = "".intern - val UUID_PREFIX = "uuid:".intern // config options val name = Config.clusterName diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala deleted file mode 100644 index 435f20d094..0000000000 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterDeployerSpec.scala +++ /dev/null @@ -1,70 +0,0 @@ -package akka.cluster - -import org.scalatest.WordSpec -import org.scalatest.matchers.MustMatchers -import org.scalatest.{ BeforeAndAfterAll, BeforeAndAfterEach } - -import org.I0Itec.zkclient._ - -import akka.actor._ -import Actor._ - -object ClusterDeployerSpec { - class HelloWorld extends Actor with Serializable { - def receive = { - case "Hello" ⇒ self.reply("World") - } - } -} - -class ClusterDeployerSpec extends WordSpec with MustMatchers with BeforeAndAfterAll with BeforeAndAfterEach { - import ClusterDeployerSpec._ - - val dataPath = "_akka_cluster/data" - val logPath = "_akka_cluster/log" - - var zkServer: ZkServer = _ - - // FIXME create multi-jvm test for ClusterDeployer to make sure that only one node can make the deployment and that all other nicely waits until he is done - - "A ClusterDeployer" should { - "be able to deploy deployments in akka.conf into ZooKeeper and then lookup the deployments by 'address'" in { - val deployments = Deployer.deploymentsInConfig - deployments must not equal (Nil) - ClusterDeployer.init(deployments) - - deployments map { oldDeployment ⇒ - val newDeployment = ClusterDeployer.lookupDeploymentFor(oldDeployment.address) - newDeployment must be('defined) - oldDeployment must equal(newDeployment.get) - } - } - - "be able to fetch deployments from ZooKeeper" in { - val deployments1 = Deployer.deploymentsInConfig - deployments1 must not equal (Nil) - ClusterDeployer.init(deployments1) - - val deployments2 = ClusterDeployer.fetchDeploymentsFromCluster - deployments2.size must equal(1) - deployments2.head must equal(deployments1.head) - } - } - - override def beforeAll() { - try { - zkServer = Cluster.startLocalCluster(dataPath, logPath) - Thread.sleep(5000) - Actor.cluster.start() - } catch { - case e ⇒ e.printStackTrace() - } - } - - override def afterAll() { - Actor.cluster.shutdown() - ClusterDeployer.shutdown() - Cluster.shutdownLocalCluster() - Actor.registry.local.shutdownAll() - } -} diff --git a/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmNode3.conf b/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmNode3.conf deleted file mode 100644 index 480c30c09d..0000000000 --- a/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmNode3.conf +++ /dev/null @@ -1 +0,0 @@ -akka.event-handler-level = "DEBUG" diff --git a/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmNode3.opts b/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmNode3.opts deleted file mode 100644 index 202496ad31..0000000000 --- a/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmNode3.opts +++ /dev/null @@ -1 +0,0 @@ --Dakka.cluster.nodename=node3 -Dakka.cluster.port=9993 diff --git a/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmSpec.scala b/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmSpec.scala index 98b22c38a2..ee7796067d 100644 --- a/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/api/migration/automatic/MigrationAutomaticMultiJvmSpec.scala @@ -91,42 +91,3 @@ class MigrationAutomaticMultiJvmNode2 extends WordSpec with MustMatchers with Be shutdownLocalCluster() } } -/* -class MigrationAutomaticMultiJvmNode3 extends WordSpec with MustMatchers { - import MigrationAutomaticMultiJvmSpec._ - - "A cluster" must { - - "be able to migrate an actor from one node to another" in { - - barrier("start-node-1", NrOfNodes) { - } - - barrier("start-node-2", NrOfNodes) { - node.start() - } - - barrier("store-1-in-node-1", NrOfNodes) { - } - - barrier("use-1-in-node-2", NrOfNodes) { - val actorOrOption = node.use("hello-world") - if (actorOrOption.isEmpty) fail("Actor could not be retrieved") - - val actorRef = actorOrOption.get - actorRef.address must be("hello-world") - - (actorRef ? "Hello").as[String].get must be("World from node [node2]") - } - - barrier("migrate-from-node2-to-node1", NrOfNodes) { - node.migrate(NodeAddress(node.nodeAddress.clusterName, "node1"), "hello-world") - Thread.sleep(2000) - } - - barrier("check-actor-is-moved-to-node1", NrOfNodes) { - } - } - } -} -*/ \ No newline at end of file diff --git a/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode1.conf b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode1.conf new file mode 100644 index 0000000000..83ba804ad1 --- /dev/null +++ b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode1.conf @@ -0,0 +1,4 @@ +akka.event-handler-level = "DEBUG" +akka.actor.deployment.service-hello.router = "round-robin" +akka.actor.deployment.service-hello.clustered.home = "node:node1" +akka.actor.deployment.service-hello.clustered.replicas = 1 diff --git a/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode1.opts b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode1.opts new file mode 100644 index 0000000000..a88c260d8c --- /dev/null +++ b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode1.opts @@ -0,0 +1 @@ +-Dakka.cluster.nodename=node1 -Dakka.cluster.port=9991 diff --git a/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode2.conf b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode2.conf new file mode 100644 index 0000000000..83ba804ad1 --- /dev/null +++ b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode2.conf @@ -0,0 +1,4 @@ +akka.event-handler-level = "DEBUG" +akka.actor.deployment.service-hello.router = "round-robin" +akka.actor.deployment.service-hello.clustered.home = "node:node1" +akka.actor.deployment.service-hello.clustered.replicas = 1 diff --git a/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode2.opts b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode2.opts new file mode 100644 index 0000000000..f1e01f253d --- /dev/null +++ b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmNode2.opts @@ -0,0 +1 @@ +-Dakka.cluster.nodename=node2 -Dakka.cluster.port=9992 diff --git a/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmSpec.scala b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmSpec.scala new file mode 100644 index 0000000000..9b3f1eb562 --- /dev/null +++ b/akka-cluster/src/test/scala/akka/cluster/deployment/DeploymentMultiJvmSpec.scala @@ -0,0 +1,88 @@ +/** + * Copyright (C) 2009-2011 Scalable Solutions AB + */ + +package akka.cluster.deployment + +import org.scalatest.WordSpec +import org.scalatest.matchers.MustMatchers +import org.scalatest.BeforeAndAfterAll + +import akka.actor._ +import Actor._ +import akka.cluster._ +import Cluster._ + +object DeploymentMultiJvmSpec { + var NrOfNodes = 2 +} + +class DeploymentMultiJvmNode1 extends WordSpec with MustMatchers with BeforeAndAfterAll { + import DeploymentMultiJvmSpec._ + + "A ClusterDeployer" must { + + "be able to deploy deployments in akka.conf and lookup the deployments by 'address'" in { + + barrier("start-node-1", NrOfNodes) { + node.start() + } + + barrier("start-node-2", NrOfNodes) { + } + + barrier("perform-deployment-on-node-1", NrOfNodes) { + Deployer.start() + // val deployments = Deployer.deploymentsInConfig + // deployments must not equal (Nil) + // ClusterDeployer.init(deployments) + } + + barrier("lookup-deployment-node-2", NrOfNodes) { + } + + node.shutdown() + } + } + + override def beforeAll() = { + startLocalCluster() + } + + override def afterAll() = { + shutdownLocalCluster() + // ClusterDeployer.shutdown() + } +} + +class DeploymentMultiJvmNode2 extends WordSpec with MustMatchers { + import DeploymentMultiJvmSpec._ + + "A cluster" must { + + "be able to store, read and remove custom configuration data" in { + + barrier("start-node-1", NrOfNodes) { + } + + barrier("start-node-2", NrOfNodes) { + node.start() + } + + barrier("perform-deployment-on-node-1", NrOfNodes) { + } + + barrier("lookup-deployment-node-2", NrOfNodes) { + Deployer.start() + val deployments = Deployer.deploymentsInConfig + deployments map { oldDeployment ⇒ + val newDeployment = ClusterDeployer.lookupDeploymentFor(oldDeployment.address) + newDeployment must be('defined) + oldDeployment must equal(newDeployment.get) + } + } + + node.shutdown() + } + } +} diff --git a/akka-docs/additional/benchmarks.rst b/akka-docs/additional/benchmarks.rst index 359914379f..6008b98f05 100644 --- a/akka-docs/additional/benchmarks.rst +++ b/akka-docs/additional/benchmarks.rst @@ -4,12 +4,9 @@ Benchmarks Scalability, Throughput and Latency benchmark --------------------------------------------- - .. image:: ../images/benchmark-akka-sample-trading-throughput.png - Simple Trading system. -- `Here is the result with some graphs `_ -- `Here is the article `_ +- `Here is the result with some graphs `_ - `Here is the code `_ Compares: