ticket 989 #Allow specifying preferred-nodes of other type than node:<name>/

currently the task has been downscoped to only allow node:name since we need to rethink this part. Metadata is going to make it /
it possible to deal with way more nodes
This commit is contained in:
Peter Veentjer 2011-08-09 13:33:10 +03:00
parent eae045ff45
commit 6a49efd966
2 changed files with 9 additions and 9 deletions

View file

@ -31,7 +31,7 @@ trait ActorDeployer {
*/
object Deployer extends ActorDeployer {
// val defaultAddress = Node(Config.nodename)
// val defaultAddress = Node(Config.nodename)
lazy val instance: ActorDeployer = {
val deployer = if (ClusterModule.isEnabled) ClusterModule.clusterDeployer else LocalDeployer

View file

@ -73,9 +73,9 @@ object DeploymentConfig {
// --- Home
// --------------------------------
sealed trait Home
// case class Host(hostName: String) extends Home
// case class Host(hostName: String) extends Home
case class Node(nodeName: String) extends Home
// case class IP(ipAddress: String) extends Home
// case class IP(ipAddress: String) extends Home
// --------------------------------
// --- Replicas
@ -137,12 +137,12 @@ object DeploymentConfig {
// --------------------------------
def nodeNameFor(home: Home): String = home match {
case Node(nodename) nodename
// case Host("localhost") Config.nodename
// case IP("0.0.0.0") Config.nodename
// case IP("127.0.0.1") Config.nodename
// case Host(hostname) throw new UnsupportedOperationException("Specifying preferred node name by 'hostname' is not yet supported. Use the node name like: preferred-nodes = [\"node:node1\"]")
// case IP(address) throw new UnsupportedOperationException("Specifying preferred node name by 'IP address' is not yet supported. Use the node name like: preferred-nodes = [\"node:node1\"]")
case Node(nodename) nodename
// case Host("localhost") Config.nodename
// case IP("0.0.0.0") Config.nodename
// case IP("127.0.0.1") Config.nodename
// case Host(hostname) throw new UnsupportedOperationException("Specifying preferred node name by 'hostname' is not yet supported. Use the node name like: preferred-nodes = [\"node:node1\"]")
// case IP(address) throw new UnsupportedOperationException("Specifying preferred node name by 'IP address' is not yet supported. Use the node name like: preferred-nodes = [\"node:node1\"]")
}
def isHomeNode(homes: Iterable[Home]): Boolean = homes exists (home nodeNameFor(home) == Config.nodename)