replace unicode arrows

* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
This commit is contained in:
Patrik Nordwall 2019-02-09 15:25:39 +01:00
parent e4d38f92a4
commit 5c96a5f556
1521 changed files with 18846 additions and 18786 deletions

View file

@ -48,7 +48,7 @@ object PerformanceSpec extends MultiNodeConfig {
class CountDown(latch: TestLatch) extends Actor {
def receive = {
case _
case _ =>
latch.countDown()
if (latch.isOpen)
context.stop(self)
@ -85,9 +85,9 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
def repeat(description: String, keys: Iterable[ORSetKey[Int]], n: Int,
expectedAfterReplication: Option[Set[Int]] = None, oneByOne: Boolean = false)(
block: (ORSetKey[Int], Int, ActorRef) Unit, afterEachKey: ORSetKey[Int] Unit = _ ()): Unit = {
block: (ORSetKey[Int], Int, ActorRef) => Unit, afterEachKey: ORSetKey[Int] => Unit = _ => ()): Unit = {
keys.foreach { key
keys.foreach { key =>
val startTime = System.nanoTime()
runOn(n1) {
val latch = TestLatch(n)
@ -106,7 +106,7 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
if (!oneByOne)
Await.ready(latch, 10.seconds + (2.second * factor))
}
expectedAfterReplication.foreach { expected
expectedAfterReplication.foreach { expected =>
enterBarrier("repeat-" + key + "-before-awaitReplicated")
awaitReplicated(key, expected)
enterBarrier("repeat-" + key + "-after-awaitReplicated")
@ -124,14 +124,14 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
}
def awaitReplicated(keys: Iterable[ORSetKey[Int]], expectedData: Set[Int]): Unit =
keys.foreach { key awaitReplicated(key, expectedData) }
keys.foreach { key => awaitReplicated(key, expectedData) }
def awaitReplicated(key: ORSetKey[Int], expectedData: Set[Int]): Unit = {
within(20.seconds) {
awaitAssert {
val readProbe = TestProbe()
replicator.tell(Get(key, ReadLocal), readProbe.ref)
val result = readProbe.expectMsgPF() { case g @ GetSuccess(`key`, _) g.get(key) }
val result = readProbe.expectMsgPF() { case g @ GetSuccess(`key`, _) => g.get(key) }
result.elements should be(expectedData)
}
}
@ -153,50 +153,50 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
}
"be great for ORSet Update WriteLocal" taggedAs PerformanceTest in {
val keys = (1 to repeatCount).map(n ORSetKey[Int]("A" + n))
val keys = (1 to repeatCount).map(n => ORSetKey[Int]("A" + n))
val n = 1000 * factor
val expectedData = (0 until n).toSet
repeat("ORSet Update WriteLocal", keys, n)({ (key, i, replyTo)
repeat("ORSet Update WriteLocal", keys, n)({ (key, i, replyTo) =>
replicator.tell(Update(key, ORSet(), WriteLocal)(_ :+ i), replyTo)
}, key awaitReplicated(key, expectedData))
}, key => awaitReplicated(key, expectedData))
enterBarrier("after-1")
}
"be blazingly fast for ORSet Get ReadLocal" taggedAs PerformanceTest in {
val keys = (1 to repeatCount).map(n ORSetKey[Int]("A" + n))
repeat("Get ReadLocal", keys, 100000 * factor) { (key, _, replyTo)
val keys = (1 to repeatCount).map(n => ORSetKey[Int]("A" + n))
repeat("Get ReadLocal", keys, 100000 * factor) { (key, _, replyTo) =>
replicator.tell(Get(key, ReadLocal), replyTo)
}
enterBarrier("after-2")
}
"be good for ORSet Update WriteLocal and gossip replication" taggedAs PerformanceTest in {
val keys = (1 to repeatCount).map(n ORSetKey[Int]("B" + n))
val keys = (1 to repeatCount).map(n => ORSetKey[Int]("B" + n))
val n = 200 * factor
val expected = Some((0 until n).toSet)
repeat("ORSet Update WriteLocal + gossip", keys, n, expected) { (key, i, replyTo)
repeat("ORSet Update WriteLocal + gossip", keys, n, expected) { (key, i, replyTo) =>
replicator.tell(Update(key, ORSet(), WriteLocal)(_ :+ i), replyTo)
}
enterBarrier("after-3")
}
"be good for ORSet Update WriteLocal and gossip of existing keys" taggedAs PerformanceTest in {
val keys = (1 to repeatCount).map(n ORSetKey[Int]("B" + n))
val keys = (1 to repeatCount).map(n => ORSetKey[Int]("B" + n))
val n = 200 * factor
val expected = Some((0 until n).toSet ++ (0 until n).map(-_).toSet)
repeat("ORSet Update WriteLocal existing + gossip", keys, n, expected) { (key, i, replyTo)
repeat("ORSet Update WriteLocal existing + gossip", keys, n, expected) { (key, i, replyTo) =>
replicator.tell(Update(key, ORSet(), WriteLocal)(_ :+ (-i)), replyTo)
}
enterBarrier("after-4")
}
"be good for ORSet Update WriteTwo and gossip replication" taggedAs PerformanceTest in {
val keys = (1 to repeatCount).map(n ORSetKey[Int]("C" + n))
val keys = (1 to repeatCount).map(n => ORSetKey[Int]("C" + n))
val n = 200 * factor
val expected = Some((0 until n).toSet)
val writeTwo = WriteTo(2, timeout)
repeat("ORSet Update WriteTwo + gossip", keys, n, expected) { (key, i, replyTo)
repeat("ORSet Update WriteTwo + gossip", keys, n, expected) { (key, i, replyTo) =>
replicator.tell(Update(key, ORSet(), writeTwo)(_ :+ i), replyTo)
}
enterBarrier("after-5")
@ -209,7 +209,7 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
runOn(n1, n2, n3) {
val latch = TestLatch(n)
val replyTo = system.actorOf(countDownProps(latch))
for (_ 0 until n)
for (_ <- 0 until n)
replicator.tell(Update(key, GCounter(), WriteLocal)(_ :+ 1), replyTo)
Await.ready(latch, 5.seconds + (1.second * factor))
enterBarrier("update-done-6")
@ -228,7 +228,7 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
awaitAssert {
val readProbe = TestProbe()
replicator.tell(Get(key, ReadLocal), readProbe.ref)
val result = readProbe.expectMsgPF() { case g @ GetSuccess(`key`, _) g.get(key) }
val result = readProbe.expectMsgPF() { case g @ GetSuccess(`key`, _) => g.get(key) }
result.value should be(3 * n)
}
}
@ -244,20 +244,20 @@ class PerformanceSpec extends MultiNodeSpec(PerformanceSpec) with STMultiNodeSpe
}
"be good for ORSet one-by-one deltas" taggedAs PerformanceTest in {
val keys = (1 to repeatCount).map(n ORSetKey[Int]("E" + n))
val keys = (1 to repeatCount).map(n => ORSetKey[Int]("E" + n))
val n = 300 * factor
val writeMajority = WriteMajority(timeout)
repeat("ORSet Update one-by-one deltas", keys, n, oneByOne = true) { (key, i, replyTo)
repeat("ORSet Update one-by-one deltas", keys, n, oneByOne = true) { (key, i, replyTo) =>
replicator.tell(Update(key, ORSet(), writeMajority)(_ :+ i), replyTo)
}
enterBarrier("after-7")
}
"be good for ORSet deltas" taggedAs PerformanceTest in {
val keys = (1 to repeatCount).map(n ORSetKey[Int]("F" + n))
val keys = (1 to repeatCount).map(n => ORSetKey[Int]("F" + n))
val n = 200 * factor
val writeMajority = WriteMajority(timeout)
repeat("ORSet Update deltas", keys, n, oneByOne = false) { (key, i, replyTo)
repeat("ORSet Update deltas", keys, n, oneByOne = false) { (key, i, replyTo) =>
replicator.tell(Update(key, ORSet(), writeMajority)(_ :+ i), replyTo)
}
enterBarrier("after-8")