- Changed implementation of Actor.actorOf to work in the the new world of cluster.ref, cluster.use and cluster.store.

- Changed semantics of replica config. Default replicas is now 0. Replica 1 means one copy of the actor is instantiated on another node.
- Actor.remote.actorFor/Actor.remote.register is now separated and orthogonal from cluster implementation.
- cluster.ref now creates and instantiates its replicas automatically, e.g. it can be created first and will then set up what it needs.
- Added logging everywhere, better warning messages etc.
- Each node now fetches the whole deployment configuration from the cluster on boot.
- Added some config options to cluster

Signed-off-by: Jonas Bonér <jonasremove@jonasboner.com>
This commit is contained in:
Jonas Bonér 2011-05-25 16:18:35 +02:00
parent 71beab820c
commit e6fa55b3a8
15 changed files with 328 additions and 217 deletions

View file

@ -29,6 +29,20 @@ trait RemoteModule {
private[akka] def actorsByUuid: ConcurrentHashMap[String, ActorRef] // FIXME remove actorsByUuid map?
private[akka] def actorsFactories: ConcurrentHashMap[String, () ActorRef] // FIXME what to do wit actorsFactories map?
private[akka] def findActorByAddress(address: String): ActorRef = actors.get(address)
private[akka] def findActorByUuid(uuid: String): ActorRef = actorsByUuid.get(uuid)
private[akka] def findActorFactory(address: String): () ActorRef = actorsFactories.get(address)
private[akka] def findActorByAddressOrUuid(address: String, uuid: String): ActorRef = {
var actorRefOrNull = if (address.startsWith(UUID_PREFIX)) findActorByUuid(address.substring(UUID_PREFIX.length))
else findActorByAddress(address)
if (actorRefOrNull eq null) actorRefOrNull = findActorByUuid(uuid)
actorRefOrNull
}
/*
private[akka] def findActorByAddress(address: String): ActorRef = {
val cachedActorRef = actors.get(address)
if (cachedActorRef ne null) cachedActorRef
@ -71,6 +85,7 @@ trait RemoteModule {
if (actorRefOrNull eq null) actorRefOrNull = findActorByUuid(uuid)
actorRefOrNull
}
*/
}
/**