=clu replace Set -- with diff and ++ with union

* better performance according to
  https://docs.google.com/presentation/d/1Qjryxoe-fYEM8ZPhM-98LKfbhnRcn5eAEMNlVVnixsA/pub
This commit is contained in:
Patrik Nordwall 2015-10-30 14:59:36 +01:00
parent 9380983d3c
commit c7c187f6b7
24 changed files with 46 additions and 46 deletions

View file

@ -46,7 +46,7 @@ abstract class TransitionSpec
def nonLeader(roles: RoleName*) = roles.toSeq.sorted.tail
def memberStatus(address: Address): MemberStatus = {
val statusOption = (clusterView.members ++ clusterView.unreachableMembers).collectFirst {
val statusOption = (clusterView.members union clusterView.unreachableMembers).collectFirst {
case m if m.address == address m.status
}
statusOption.getOrElse(Removed)
@ -91,7 +91,7 @@ abstract class TransitionSpec
clusterView.latestStats.gossipStats.receivedGossipCount != oldCount // received gossip
}
// gossip chat will synchronize the views
awaitCond((Set(fromRole, toRole) -- seenLatestGossip).isEmpty)
awaitCond((Set(fromRole, toRole) diff seenLatestGossip).isEmpty)
enterBarrier("after-gossip-" + gossipBarrierCounter)
}
runOn(fromRole) {
@ -99,7 +99,7 @@ abstract class TransitionSpec
// send gossip
cluster.clusterCore ! InternalClusterAction.SendGossipTo(toRole)
// gossip chat will synchronize the views
awaitCond((Set(fromRole, toRole) -- seenLatestGossip).isEmpty)
awaitCond((Set(fromRole, toRole) diff seenLatestGossip).isEmpty)
enterBarrier("after-gossip-" + gossipBarrierCounter)
}
runOn(roles.filterNot(r r == fromRole || r == toRole): _*) {