rename top-level paths as per Jonas recommendation

/user
/system
/null
/temp
/remote
/service

multi-jvm tests are disabled for the time being until remote look-up has
been really implemented
This commit is contained in:
Roland 2011-12-02 09:34:19 +01:00
parent 6b9cdc5f65
commit cf020d708a
22 changed files with 94 additions and 86 deletions

View file

@ -14,59 +14,59 @@ import com.typesafe.config.ConfigParseOptions
object DeployerSpec {
val deployerConf = ConfigFactory.parseString("""
akka.actor.deployment {
/app/service1 {
/user/service1 {
}
/app/service2 {
/user/service2 {
router = round-robin
nr-of-instances = 3
remote {
nodes = ["wallace:2552", "gromit:2552"]
}
}
/app/service3 {
/user/service3 {
create-as {
class = "akka.actor.DeployerSpec$RecipeActor"
}
}
/app/service-auto {
/user/service-auto {
router = round-robin
nr-of-instances = auto
}
/app/service-direct {
/user/service-direct {
router = direct
}
/app/service-direct2 {
/user/service-direct2 {
router = direct
# nr-of-instances ignored when router = direct
nr-of-instances = 2
}
/app/service-round-robin {
/user/service-round-robin {
router = round-robin
}
/app/service-random {
/user/service-random {
router = random
}
/app/service-scatter-gather {
/user/service-scatter-gather {
router = scatter-gather
}
/app/service-least-cpu {
/user/service-least-cpu {
router = least-cpu
}
/app/service-least-ram {
/user/service-least-ram {
router = least-ram
}
/app/service-least-messages {
/user/service-least-messages {
router = least-messages
}
/app/service-custom {
/user/service-custom {
router = org.my.Custom
}
/app/service-cluster1 {
/user/service-cluster1 {
cluster {
preferred-nodes = ["node:wallace", "node:gromit"]
}
}
/app/service-cluster2 {
/user/service-cluster2 {
cluster {
preferred-nodes = ["node:wallace", "node:gromit"]
replication {
@ -89,7 +89,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
"A Deployer" must {
"be able to parse 'akka.actor.deployment._' with all default values" in {
val service = "/app/service1"
val service = "/user/service1"
val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookupDeployment(service)
deployment must be('defined)
@ -103,13 +103,13 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
}
"use None deployment for undefined service" in {
val service = "/app/undefined"
val service = "/user/undefined"
val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookupDeployment(service)
deployment must be(None)
}
"be able to parse 'akka.actor.deployment._' with specified remote nodes" in {
val service = "/app/service2"
val service = "/user/service2"
val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookupDeployment(service)
deployment must be('defined)
@ -124,7 +124,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
}
"be able to parse 'akka.actor.deployment._' with recipe" in {
val service = "/app/service3"
val service = "/user/service3"
val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookupDeployment(service)
deployment must be('defined)
@ -138,7 +138,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
}
"be able to parse 'akka.actor.deployment._' with number-of-instances=auto" in {
val service = "/app/service-auto"
val service = "/user/service-auto"
val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookupDeployment(service)
deployment must be('defined)
@ -155,7 +155,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
intercept[akka.config.ConfigurationException] {
val invalidDeployerConf = ConfigFactory.parseString("""
akka.actor.deployment {
/app/service-invalid-number-of-instances {
/user/service-invalid-number-of-instances {
router = round-robin
nr-of-instances = boom
}
@ -167,38 +167,38 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
}
"be able to parse 'akka.actor.deployment._' with direct router" in {
assertRouting(Direct, "/app/service-direct")
assertRouting(Direct, "/user/service-direct")
}
"ignore nr-of-instances with direct router" in {
assertRouting(Direct, "/app/service-direct2")
assertRouting(Direct, "/user/service-direct2")
}
"be able to parse 'akka.actor.deployment._' with round-robin router" in {
assertRouting(RoundRobin, "/app/service-round-robin")
assertRouting(RoundRobin, "/user/service-round-robin")
}
"be able to parse 'akka.actor.deployment._' with random router" in {
assertRouting(Random, "/app/service-random")
assertRouting(Random, "/user/service-random")
}
"be able to parse 'akka.actor.deployment._' with scatter-gather router" in {
assertRouting(ScatterGather, "/app/service-scatter-gather")
assertRouting(ScatterGather, "/user/service-scatter-gather")
}
"be able to parse 'akka.actor.deployment._' with least-cpu router" in {
assertRouting(LeastCPU, "/app/service-least-cpu")
assertRouting(LeastCPU, "/user/service-least-cpu")
}
"be able to parse 'akka.actor.deployment._' with least-ram router" in {
assertRouting(LeastRAM, "/app/service-least-ram")
assertRouting(LeastRAM, "/user/service-least-ram")
}
"be able to parse 'akka.actor.deployment._' with least-messages router" in {
assertRouting(LeastMessages, "/app/service-least-messages")
assertRouting(LeastMessages, "/user/service-least-messages")
}
"be able to parse 'akka.actor.deployment._' with custom router" in {
assertRouting(CustomRouter("org.my.Custom"), "/app/service-custom")
assertRouting(CustomRouter("org.my.Custom"), "/user/service-custom")
}
def assertRouting(expected: Routing, service: String) {
@ -216,7 +216,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
}
"be able to parse 'akka.actor.deployment._' with specified cluster nodes" in {
val service = "/app/service-cluster1"
val service = "/user/service-cluster1"
val deploymentConfig = system.asInstanceOf[ActorSystemImpl].provider.deployer.deploymentConfig
val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookupDeployment(service)
deployment must be('defined)
@ -230,7 +230,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
}
"be able to parse 'akka.actor.deployment._' with specified cluster replication" in {
val service = "/app/service-cluster2"
val service = "/user/service-cluster2"
val deploymentConfig = system.asInstanceOf[ActorSystemImpl].provider.deployer.deploymentConfig
val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookupDeployment(service)
deployment must be('defined)

View file

@ -359,7 +359,7 @@ class DeadLetterActorRef(val eventStream: EventStream) extends MinimalActorRef {
}
private[akka] def init(dispatcher: MessageDispatcher, rootPath: ActorPath) {
_path = rootPath / "nul"
_path = rootPath / "null"
brokenPromise = new KeptPromise[Any](Left(new ActorKilledException("In DeadLetterActorRef, promises are always broken.")))(dispatcher)
}

View file

@ -204,7 +204,7 @@ class LocalActorRefProvider(
private def tempName = "$_" + Helpers.base64(tempNumber.getAndIncrement())
private val tempNode = rootPath / "tmp"
private val tempNode = rootPath / "temp"
def tempPath = tempNode / tempName
@ -281,8 +281,8 @@ class LocalActorRefProvider(
lazy val terminationFuture: DefaultPromise[Unit] = new DefaultPromise[Unit](Timeout.never)(dispatcher)
lazy val rootGuardian: ActorRef = new LocalActorRef(system, guardianProps, theOneWhoWalksTheBubblesOfSpaceTime, rootPath, true)
lazy val guardian: ActorRef = actorOf(system, guardianProps, rootGuardian, "app", true)
lazy val systemGuardian: ActorRef = actorOf(system, guardianProps.withCreator(new SystemGuardian), rootGuardian, "sys", true)
lazy val guardian: ActorRef = actorOf(system, guardianProps, rootGuardian, "user", true)
lazy val systemGuardian: ActorRef = actorOf(system, guardianProps.withCreator(new SystemGuardian), rootGuardian, "system", true)
val deathWatch = createDeathWatch()

View file

@ -28,6 +28,10 @@ depending on the configuration of the actor system:
actors within the same JVM. In order to be recognizable also when sent to
other network nodes, these references include protocol and remote addressing
information.
- There is a subtype of local actor references which is used for routers (i.e.
actors mixing in the :class:`Router` trait). Its logical structure is the
same as for the aforementioned local references, but sending a message to
them dispatches to one of their children directly instead.
- Remote actor references represent actors which are reachable using remote
communication, i.e. sending messages to them will serialize the messages
transparently and send them to the other JVM.
@ -246,15 +250,19 @@ Special Paths used by Akka
At the root of the path hierarchy resides the root guardian above which all
other actors are found. The next level consists of the following:
- ``"/app"`` is the guardian actor for all user-created top-level actors;
- ``"/user"`` is the guardian actor for all user-created top-level actors;
actors created using :meth:`ActorSystem.actorOf` are found at the next level.
- ``"/sys"`` is the guardian actor for all system-created top-level actors,
- ``"/system"`` is the guardian actor for all system-created top-level actors,
e.g. logging listeners or actors automatically deployed by configuration at
the start of the actor system.
- ``"/nil"`` is the dead letter actor, which is where all messages sent to
- ``"/null"`` is the dead letter actor, which is where all messages sent to
stopped or non-existing actors are re-routed.
- ``"/tmp"`` is the guardian for all short-lived system-created actors, e.g.
- ``"/temp"`` is the guardian for all short-lived system-created actors, e.g.
those which are used in the implementation of :meth:`ActorRef.ask`.
- ``"/remote"`` is an artificial path below which all actors reside whose
supervisors are remote actor references
- ``"/service"`` is an artificial path below which actors can be presented by
means of configuration, i.e. deployed at system start-up or just-in-time
(triggered by look-up) or “mounting” other actors by path—local or remote—to
give them logical names.

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "direct"
/app/service-hello.nr-of-instances = 1
/app/service-hello.remote.nodes = ["localhost:9991"]
/user/service-hello.router = "direct"
/user/service-hello.nr-of-instances = 1
/user/service-hello.remote.nodes = ["localhost:9991"]
}
}
}

View file

@ -3,9 +3,9 @@ qakka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "direct"
/app/service-hello.nr-of-instances = 1
/app/service-hello.remote.nodes = ["localhost:9991"]
/user/service-hello.router = "direct"
/user/service-hello.nr-of-instances = 1
/user/service-hello.remote.nodes = ["localhost:9991"]
}
}
}

View file

@ -48,7 +48,7 @@ class DirectRoutedRemoteActorMultiJvmNode2 extends AkkaRemoteSpec {
barrier("start")
val actor = system.actorOf[SomeActor]("service-hello")
actor.isInstanceOf[RoutedActorRef] must be(true)
//actor.isInstanceOf[RoutedActorRef] must be(true)
val result = (actor ? "identify").get
result must equal("node1")

View file

@ -3,7 +3,7 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.remote.nodes = ["localhost:9991"]
/user/service-hello.remote.nodes = ["localhost:9991"]
}
}
}

View file

@ -3,7 +3,7 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.remote.nodes = ["localhost:9991"]
/user/service-hello.remote.nodes = ["localhost:9991"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "random"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "random"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -2,8 +2,8 @@ akka {
loglevel = "WARNING"
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment./app/service-hello.router = "random"
deployment./app/service-hello.nr-of-instances = 3
deployment./app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
deployment./user/service-hello.router = "random"
deployment./user/service-hello.nr-of-instances = 3
deployment./user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "random"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "random"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "random"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "random"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "round-robin"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "round-robin"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "round-robin"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "round-robin"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "round-robin"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "round-robin"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "round-robin"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "round-robin"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "scatter-gather"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "scatter-gather"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "scatter-gather"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "scatter-gather"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "scatter-gather"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "scatter-gather"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -3,9 +3,9 @@ akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
/app/service-hello.router = "scatter-gather"
/app/service-hello.nr-of-instances = 3
/app/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
/user/service-hello.router = "scatter-gather"
/user/service-hello.nr-of-instances = 3
/user/service-hello.remote.nodes = ["localhost:9991","localhost:9992","localhost:9993"]
}
}
}

View file

@ -81,7 +81,7 @@ object AkkaBuild extends Build {
id = "akka-remote",
base = file("akka-remote"),
dependencies = Seq(stm, actorTests % "test->test", testkit % "test->test"),
settings = defaultSettings ++ multiJvmSettings ++ Seq(
settings = defaultSettings /*++ multiJvmSettings*/ ++ Seq(
libraryDependencies ++= Dependencies.cluster,
extraOptions in MultiJvm <<= (sourceDirectory in MultiJvm) { src =>
(name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq