Merged with master

This commit is contained in:
Jonas Bonér 2012-02-16 11:20:51 +01:00
parent 07defa71a4
commit 84f886def1
2 changed files with 5 additions and 15 deletions

View file

@ -238,7 +238,7 @@ case class Gossiper(system: ActorSystemImpl, remote: RemoteActorRefProvider) {
log.info("Node [{}] - Starting cluster Gossiper...", remoteAddress)
// try to join the node defined in the 'akka.cluster.node-to-join' option
nodeToJoin foreach join
join()
// start periodic gossip to random nodes in cluster
val gossipCanceller = system.scheduler.schedule(gossipInitialDelay, gossipFrequency) {
@ -382,22 +382,12 @@ case class Gossiper(system: ActorSystemImpl, remote: RemoteActorRefProvider) {
/**
* Joins the pre-configured contact point and retrieves current gossip state.
*/
private def join(address: Address) {
private def join() = nodeToJoin foreach { address
setUpConnectionTo(address) foreach { connection
val command = Join(remoteAddress)
log.info("Node [{}] - Sending [{}] to [{}]", remoteAddress, command, address)
log.info("Node [{}] - Sending [{}] to [{}] through connection [{}]", remoteAddress, command, address, connection)
connection ! command
}
contactPoint match {
case None log.info("Booting up in singleton cluster mode")
case Some(member)
log.info("Trying to join contact point node defined in the configuration [{}]", member)
setUpConnectionTo(member) match {
case None log.error("Could not set up connection to join contact point node defined in the configuration [{}]", member)
case Some(connection) tryJoinContactPoint(connection, deadline)
}
}
}
/**

View file

@ -9,8 +9,8 @@ class AccrualFailureDetectorSpec extends AkkaSpec("""
""") {
"An AccrualFailureDetector" must {
val conn = Address("akka", "", Some("localhost"), Some(2552))
val conn2 = Address("akka", "", Some("localhost"), Some(2553))
val conn = Address("akka", "", "localhost", 2552)
val conn2 = Address("akka", "", "localhost", 2553)
"return phi value of 0.0D on startup for each address" in {
val fd = new AccrualFailureDetector(system)