Minor changes and some added FIXMEs

This commit is contained in:
Jonas Bonér 2011-05-25 17:41:53 +02:00
parent 7311a8b16a
commit abe6047284
4 changed files with 13 additions and 40 deletions

View file

@ -418,7 +418,6 @@ object Actor extends ListenerManagement {
}
if (isHomeNode) { // home node for clustered actor
// home node, check out as LocalActorRef
cluster
.use(address, serializer)
.getOrElse(throw new ConfigurationException(
@ -428,24 +427,11 @@ object Actor extends ListenerManagement {
if (!cluster.isClustered(address)) {
cluster.store(factory().start(), replicas, false, serializer) // add actor to cluster registry (if not already added)
}
// Thread.sleep(5000)
// remote node (not home node), check out as ClusterActorRef
cluster.ref(address, DeploymentConfig.routerTypeFor(router))
}
/*
Misc stuff:
- How to define a single ClusterNode to use? Where should it be booted up? How should it be configured?
- ClusterNode API and Actor.remote API should be made private[akka]
- Rewrite ClusterSpec or remove it
- Actor.stop on home node (actor checked out with cluster.use(..)) should do cluster.remove(..) of actor
- Should we allow configuring of session-scoped remote actors? How?
*/
// RemoteActorRef(address, Actor.TIMEOUT, None)
case invalid throw new IllegalActorStateException(
"Could not create actor with address [" + address +
"], not bound to a valid deployment scheme [" + invalid + "]")

View file

@ -997,22 +997,7 @@ private[akka] case class RemoteActorRef private[akka] (
timeout = _timeout
// FIXME BAD, we should not have different ActorRefs
/*
import DeploymentConfig._
val remoteAddress = Deployer.deploymentFor(address) match {
case Deploy(_, _, _, Clustered(home, _, _))
val hostname = home match {
case Host(hostname) hostname
case IP(address) address
case Node(nodeName) Config.hostname
}
new InetSocketAddress(hostname, Config.remoteServerPort)
case _
new InetSocketAddress(Config.hostname, Config.remoteServerPort)
//throw new IllegalStateException(
// "Actor with Address [" + address + "] is not bound to a Clustered Deployment")
}
*/
start()
def postMessageToMailbox(message: Any, senderOption: Option[ActorRef]) {

View file

@ -1142,9 +1142,8 @@ class DefaultClusterNode private[akka] (
* Connect to all available replicas unless already connected).
*/
private def connectToAllMembershipNodesInCluster() {
val runOnThisNode = false // (node: String) !excludeRefNodeInReplicaSet && node != Config.nodename
membershipNodes foreach { node
// if (runOnThisNode(node) && !replicaConnections.contains(node)) { // only connect to each replica once
if ((node != Config.nodename)) { // no replica on the "home" node of the ref
if (!replicaConnections.contains(node)) { // only connect to each replica once
val address = addressForNode(node)
EventHandler.debug(this,
@ -1154,6 +1153,7 @@ class DefaultClusterNode private[akka] (
}
}
}
}
private[cluster] def joinMembershipNode() {
nodeNameToAddress.put(nodeAddress.nodeName, remoteServerAddress)

View file

@ -144,7 +144,9 @@ object ClusterDeployer {
println("------------ INIT 2")
val allDeployments = deployments ::: systemDeployments
// FIXME need to wrap in if (!deploymentDone) { .. }
///===========================================================
// FIXME need a flag 'deploymentDone' in ZK and to wrap the deployment in 'if (!deploymentDone) { .. }', since now the deployment is only protected by lock during the actual deployment, if node comes in later then deployment is repeated on that node again
///===========================================================
if (deploymentLock.lock()) {
println("------------ INIT 3")