2012-01-31 15:00:46 +01:00
|
|
|
/**
|
2014-02-02 19:05:45 -06:00
|
|
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
2012-01-31 15:00:46 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package akka.cluster
|
|
|
|
|
|
2012-06-25 17:21:06 +02:00
|
|
|
import language.postfixOps
|
2012-01-31 15:00:46 +01:00
|
|
|
import akka.testkit.AkkaSpec
|
2012-06-29 16:24:24 +02:00
|
|
|
import akka.dispatch.Dispatchers
|
2012-09-21 14:50:06 +02:00
|
|
|
import scala.concurrent.duration._
|
2013-01-29 11:55:33 +01:00
|
|
|
import akka.remote.PhiAccrualFailureDetector
|
2014-01-09 14:09:52 +01:00
|
|
|
import akka.util.Helpers.ConfigOps
|
2012-01-31 15:00:46 +01:00
|
|
|
|
|
|
|
|
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
2012-05-04 15:03:23 +02:00
|
|
|
class ClusterConfigSpec extends AkkaSpec {
|
2012-01-31 15:00:46 +01:00
|
|
|
|
|
|
|
|
"Clustering" must {
|
|
|
|
|
|
|
|
|
|
"be able to parse generic cluster config elements" in {
|
|
|
|
|
val settings = new ClusterSettings(system.settings.config, system.name)
|
|
|
|
|
import settings._
|
2013-12-17 14:25:56 +01:00
|
|
|
LogInfo should be(true)
|
|
|
|
|
FailureDetectorConfig.getDouble("threshold") should be(8.0 +- 0.0001)
|
|
|
|
|
FailureDetectorConfig.getInt("max-sample-size") should be(1000)
|
2014-01-09 14:09:52 +01:00
|
|
|
FailureDetectorConfig.getMillisDuration("min-std-deviation") should be(100 millis)
|
|
|
|
|
FailureDetectorConfig.getMillisDuration("acceptable-heartbeat-pause") should be(3 seconds)
|
2013-12-17 14:25:56 +01:00
|
|
|
FailureDetectorImplementationClass should be(classOf[PhiAccrualFailureDetector].getName)
|
|
|
|
|
SeedNodes should be(Seq.empty[String])
|
|
|
|
|
SeedNodeTimeout should be(5 seconds)
|
|
|
|
|
RetryUnsuccessfulJoinAfter should be(10 seconds)
|
|
|
|
|
PeriodicTasksInitialDelay should be(1 seconds)
|
|
|
|
|
GossipInterval should be(1 second)
|
|
|
|
|
GossipTimeToLive should be(2 seconds)
|
|
|
|
|
HeartbeatInterval should be(1 second)
|
|
|
|
|
MonitoredByNrOfMembers should be(5)
|
|
|
|
|
HeartbeatExpectedResponseAfter should be(5 seconds)
|
|
|
|
|
LeaderActionsInterval should be(1 second)
|
|
|
|
|
UnreachableNodesReaperInterval should be(1 second)
|
|
|
|
|
PublishStatsInterval should be(Duration.Undefined)
|
|
|
|
|
AutoDownUnreachableAfter should be(Duration.Undefined)
|
|
|
|
|
MinNrOfMembers should be(1)
|
2014-01-31 11:14:13 +01:00
|
|
|
MinNrOfMembersOfRole should be(Map.empty)
|
|
|
|
|
Roles should be(Set.empty)
|
2013-12-17 14:25:56 +01:00
|
|
|
JmxEnabled should be(true)
|
|
|
|
|
UseDispatcher should be(Dispatchers.DefaultDispatcherId)
|
|
|
|
|
GossipDifferentViewProbability should be(0.8 +- 0.0001)
|
|
|
|
|
ReduceGossipDifferentViewProbability should be(400)
|
|
|
|
|
SchedulerTickDuration should be(33 millis)
|
|
|
|
|
SchedulerTicksPerWheel should be(512)
|
2014-12-12 11:49:32 -06:00
|
|
|
// TODO remove metrics
|
2013-12-17 14:25:56 +01:00
|
|
|
MetricsEnabled should be(true)
|
|
|
|
|
MetricsCollectorClass should be(classOf[SigarMetricsCollector].getName)
|
|
|
|
|
MetricsInterval should be(3 seconds)
|
|
|
|
|
MetricsGossipInterval should be(3 seconds)
|
|
|
|
|
MetricsMovingAverageHalfLife should be(12 seconds)
|
2012-01-31 15:00:46 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|