Publish member events when state change first seen, see #3075

* Remove InstantMemberEvent
This commit is contained in:
Patrik Nordwall 2013-03-05 21:05:11 +01:00
parent 5c7747e7fa
commit 5b844ec1e6
32 changed files with 145 additions and 517 deletions

View file

@ -151,22 +151,13 @@ trait MultiNodeClusterSpec extends Suite with STMultiNodeSpec { self: MultiNodeS
clusterView.self
}
/**
* Initialize the cluster with the specified member
* nodes (roles). First node will be started first
* and others will join the first.
*/
def startCluster(roles: RoleName*): Unit = awaitStartCluster(false, roles.to[immutable.Seq])
/**
* Initialize the cluster of the specified member
* nodes (roles) and wait until all joined and `Up`.
* First node will be started first and others will join
* the first.
*/
def awaitClusterUp(roles: RoleName*): Unit = awaitStartCluster(true, roles.to[immutable.Seq])
private def awaitStartCluster(upConvergence: Boolean = true, roles: immutable.Seq[RoleName]): Unit = {
def awaitClusterUp(roles: RoleName*): Unit = {
runOn(roles.head) {
// make sure that the node-to-join is started before other join
startClusterNode()
@ -175,8 +166,8 @@ trait MultiNodeClusterSpec extends Suite with STMultiNodeSpec { self: MultiNodeS
if (roles.tail.contains(myself)) {
cluster.join(roles.head)
}
if (upConvergence && roles.contains(myself)) {
awaitUpConvergence(numberOfMembers = roles.length)
if (roles.contains(myself)) {
awaitMembersUp(numberOfMembers = roles.length)
}
enterBarrier(roles.map(_.name).mkString("-") + "-joined")
}
@ -212,10 +203,10 @@ trait MultiNodeClusterSpec extends Suite with STMultiNodeSpec { self: MultiNodeS
}
/**
* Wait until the expected number of members has status Up and convergence has been reached.
* Wait until the expected number of members has status Up has been reached.
* Also asserts that nodes in the 'canNotBePartOfMemberRing' are *not* part of the cluster ring.
*/
def awaitUpConvergence(
def awaitMembersUp(
numberOfMembers: Int,
canNotBePartOfMemberRing: Set[Address] = Set.empty,
timeout: FiniteDuration = 20.seconds): Unit = {