Revert "Introduce cluster 'team' setting and add to Member"
This reverts commit a06badaa03fa9f3c9a942b1468090f758c74a869.
This commit is contained in:
parent
bd6afb8952
commit
a7dc938188
8 changed files with 8 additions and 57 deletions
|
|
@ -65,11 +65,6 @@ akka {
|
||||||
# move 'WeaklyUp' members to 'Up' status once convergence has been reached.
|
# move 'WeaklyUp' members to 'Up' status once convergence has been reached.
|
||||||
allow-weakly-up-members = on
|
allow-weakly-up-members = on
|
||||||
|
|
||||||
# Teams are used to make islands of the cluster that are colocated. It can be used
|
|
||||||
# to make the cluster "dc-aware", run the cluster in multiple availability zones or regions.
|
|
||||||
# The team is added to the list of roles of the node with the prefix "team-".
|
|
||||||
team = "default"
|
|
||||||
|
|
||||||
# The roles of this member. List of strings, e.g. roles = ["A", "B"].
|
# The roles of this member. List of strings, e.g. roles = ["A", "B"].
|
||||||
# The roles are part of the membership information and can be used by
|
# The roles are part of the membership information and can be used by
|
||||||
# routers or other services to distribute work to certain member types,
|
# routers or other services to distribute work to certain member types,
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,7 @@ final class ClusterSettings(val config: Config, val systemName: String) {
|
||||||
|
|
||||||
val AllowWeaklyUpMembers = cc.getBoolean("allow-weakly-up-members")
|
val AllowWeaklyUpMembers = cc.getBoolean("allow-weakly-up-members")
|
||||||
|
|
||||||
val Team: String = cc.getString("team")
|
val Roles: Set[String] = immutableSeq(cc.getStringList("roles")).toSet
|
||||||
val Roles: Set[String] = immutableSeq(cc.getStringList("roles")).toSet + s"team-$Team"
|
|
||||||
val MinNrOfMembers: Int = {
|
val MinNrOfMembers: Int = {
|
||||||
cc.getInt("min-nr-of-members")
|
cc.getInt("min-nr-of-members")
|
||||||
} requiring (_ > 0, "min-nr-of-members must be > 0")
|
} requiring (_ > 0, "min-nr-of-members must be > 0")
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,6 @@ class Member private[cluster] (
|
||||||
val status: MemberStatus,
|
val status: MemberStatus,
|
||||||
val roles: Set[String]) extends Serializable {
|
val roles: Set[String]) extends Serializable {
|
||||||
|
|
||||||
lazy val team = roles.find(_.startsWith("team-"))
|
|
||||||
.getOrElse(throw new IllegalStateException("Team undefined, should not be possible"))
|
|
||||||
|
|
||||||
def address: Address = uniqueAddress.address
|
def address: Address = uniqueAddress.address
|
||||||
|
|
||||||
override def hashCode = uniqueAddress.##
|
override def hashCode = uniqueAddress.##
|
||||||
|
|
|
||||||
|
|
@ -120,32 +120,28 @@ abstract class MBeanSpec
|
||||||
| {
|
| {
|
||||||
| "address": "${sortedNodes(0)}",
|
| "address": "${sortedNodes(0)}",
|
||||||
| "roles": [
|
| "roles": [
|
||||||
| "testNode",
|
| "testNode"
|
||||||
| "team-default"
|
|
||||||
| ],
|
| ],
|
||||||
| "status": "Up"
|
| "status": "Up"
|
||||||
| },
|
| },
|
||||||
| {
|
| {
|
||||||
| "address": "${sortedNodes(1)}",
|
| "address": "${sortedNodes(1)}",
|
||||||
| "roles": [
|
| "roles": [
|
||||||
| "testNode",
|
| "testNode"
|
||||||
| "team-default"
|
|
||||||
| ],
|
| ],
|
||||||
| "status": "Up"
|
| "status": "Up"
|
||||||
| },
|
| },
|
||||||
| {
|
| {
|
||||||
| "address": "${sortedNodes(2)}",
|
| "address": "${sortedNodes(2)}",
|
||||||
| "roles": [
|
| "roles": [
|
||||||
| "testNode",
|
| "testNode"
|
||||||
| "team-default"
|
|
||||||
| ],
|
| ],
|
||||||
| "status": "Up"
|
| "status": "Up"
|
||||||
| },
|
| },
|
||||||
| {
|
| {
|
||||||
| "address": "${sortedNodes(3)}",
|
| "address": "${sortedNodes(3)}",
|
||||||
| "roles": [
|
| "roles": [
|
||||||
| "testNode",
|
| "testNode"
|
||||||
| "team-default"
|
|
||||||
| ],
|
| ],
|
||||||
| "status": "Up"
|
| "status": "Up"
|
||||||
| }
|
| }
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ abstract class QuickRestartSpec
|
||||||
Cluster(system).state.members.size should ===(totalNumberOfNodes)
|
Cluster(system).state.members.size should ===(totalNumberOfNodes)
|
||||||
Cluster(system).state.members.map(_.status == MemberStatus.Up)
|
Cluster(system).state.members.map(_.status == MemberStatus.Up)
|
||||||
// use the role to test that it is the new incarnation that joined, sneaky
|
// use the role to test that it is the new incarnation that joined, sneaky
|
||||||
Cluster(system).state.members.flatMap(_.roles) should ===(Set(s"round-$n", "team-default"))
|
Cluster(system).state.members.flatMap(_.roles) should ===(Set(s"round-$n"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enterBarrier("members-up-" + n)
|
enterBarrier("members-up-" + n)
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,9 @@
|
||||||
package akka.cluster
|
package akka.cluster
|
||||||
|
|
||||||
import language.postfixOps
|
import language.postfixOps
|
||||||
import scala.concurrent.duration._
|
|
||||||
|
|
||||||
import com.typesafe.config.ConfigFactory
|
|
||||||
|
|
||||||
import akka.testkit.AkkaSpec
|
import akka.testkit.AkkaSpec
|
||||||
import akka.dispatch.Dispatchers
|
import akka.dispatch.Dispatchers
|
||||||
|
import scala.concurrent.duration._
|
||||||
import akka.remote.PhiAccrualFailureDetector
|
import akka.remote.PhiAccrualFailureDetector
|
||||||
import akka.util.Helpers.ConfigOps
|
import akka.util.Helpers.ConfigOps
|
||||||
import akka.actor.Address
|
import akka.actor.Address
|
||||||
|
|
@ -45,8 +41,7 @@ class ClusterConfigSpec extends AkkaSpec {
|
||||||
DownRemovalMargin should ===(Duration.Zero)
|
DownRemovalMargin should ===(Duration.Zero)
|
||||||
MinNrOfMembers should ===(1)
|
MinNrOfMembers should ===(1)
|
||||||
MinNrOfMembersOfRole should ===(Map.empty[String, Int])
|
MinNrOfMembersOfRole should ===(Map.empty[String, Int])
|
||||||
Team should ===("default")
|
Roles should ===(Set.empty[String])
|
||||||
Roles should ===(Set("team-default"))
|
|
||||||
JmxEnabled should ===(true)
|
JmxEnabled should ===(true)
|
||||||
UseDispatcher should ===(Dispatchers.DefaultDispatcherId)
|
UseDispatcher should ===(Dispatchers.DefaultDispatcherId)
|
||||||
GossipDifferentViewProbability should ===(0.8 +- 0.0001)
|
GossipDifferentViewProbability should ===(0.8 +- 0.0001)
|
||||||
|
|
@ -54,20 +49,5 @@ class ClusterConfigSpec extends AkkaSpec {
|
||||||
SchedulerTickDuration should ===(33 millis)
|
SchedulerTickDuration should ===(33 millis)
|
||||||
SchedulerTicksPerWheel should ===(512)
|
SchedulerTicksPerWheel should ===(512)
|
||||||
}
|
}
|
||||||
|
|
||||||
"be able to parse non-default cluster config elements" in {
|
|
||||||
val settings = new ClusterSettings(ConfigFactory.parseString(
|
|
||||||
"""
|
|
||||||
|akka {
|
|
||||||
| cluster {
|
|
||||||
| roles = [ "hamlet" ]
|
|
||||||
| team = "blue"
|
|
||||||
| }
|
|
||||||
|}
|
|
||||||
""".stripMargin).withFallback(ConfigFactory.load()), system.name)
|
|
||||||
import settings._
|
|
||||||
Roles should ===(Set("hamlet", "team-blue"))
|
|
||||||
Team should ===("blue")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
../scala/cluster-team.md
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
# Cluster Team
|
|
||||||
|
|
||||||
@@@ note
|
|
||||||
|
|
||||||
Cluster teams are a work-in-progress feature, and behavior is still expected to change.
|
|
||||||
|
|
||||||
@@@
|
|
||||||
|
|
||||||
Teams are used to define islands of the cluster that are colocated.
|
|
||||||
They can be used to make the cluster "dc-aware", run the cluster in multiple availability zones or regions.
|
|
||||||
|
|
||||||
Cluster nodes can be assigned to a team by setting the `akka.cluster.team` setting.
|
|
||||||
When no team is specified, a node will belong to the 'default' team.
|
|
||||||
|
|
||||||
The team is added to the list of roles of the node with the prefix "team-".
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue