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

@ -73,7 +73,7 @@ object DistributedDataDocSpec {
replicator ! Subscribe(DataKey, self)
def receive = {
case Tick
case Tick =>
val s = ThreadLocalRandom.current().nextInt(97, 123).toChar.toString
if (ThreadLocalRandom.current().nextBoolean()) {
// add
@ -85,9 +85,9 @@ object DistributedDataDocSpec {
replicator ! Update(DataKey, ORSet.empty[String], WriteLocal)(_ remove s)
}
case _: UpdateResponse[_] // ignore
case _: UpdateResponse[_] => // ignore
case c @ Changed(DataKey)
case c @ Changed(DataKey) =>
val data = c.get(DataKey)
log.info("Current elements: {}", data.elements)
}
@ -129,19 +129,19 @@ class DistributedDataDocSpec extends AkkaSpec(DistributedDataDocSpec.config) {
probe.expectMsgType[UpdateResponse[_]] match {
//#update-response1
case UpdateSuccess(Counter1Key, req) // ok
case UpdateSuccess(Counter1Key, req) => // ok
//#update-response1
case unexpected fail("Unexpected response: " + unexpected)
case unexpected => fail("Unexpected response: " + unexpected)
}
probe.expectMsgType[UpdateResponse[_]] match {
//#update-response2
case UpdateSuccess(Set1Key, req) // ok
case UpdateTimeout(Set1Key, req)
case UpdateSuccess(Set1Key, req) => // ok
case UpdateTimeout(Set1Key, req) =>
// write to 3 nodes failed within 1.second
//#update-response2
case UpdateSuccess(Set2Key, None)
case unexpected fail("Unexpected response: " + unexpected)
case UpdateSuccess(Set2Key, None) =>
case unexpected => fail("Unexpected response: " + unexpected)
}
}
@ -158,14 +158,14 @@ class DistributedDataDocSpec extends AkkaSpec(DistributedDataDocSpec.config) {
val Counter1Key = PNCounterKey("counter1")
def receive: Receive = {
case "increment"
case "increment" =>
// incoming command to increase the counter
val upd = Update(Counter1Key, PNCounter(), writeTwo, request = Some(sender()))(_ :+ 1)
replicator ! upd
case UpdateSuccess(Counter1Key, Some(replyTo: ActorRef))
case UpdateSuccess(Counter1Key, Some(replyTo: ActorRef)) =>
replyTo ! "ack"
case UpdateTimeout(Counter1Key, Some(replyTo: ActorRef))
case UpdateTimeout(Counter1Key, Some(replyTo: ActorRef)) =>
replyTo ! "nack"
}
//#update-request-context
@ -196,24 +196,24 @@ class DistributedDataDocSpec extends AkkaSpec(DistributedDataDocSpec.config) {
probe.expectMsgType[GetResponse[_]] match {
//#get-response1
case g @ GetSuccess(Counter1Key, req)
case g @ GetSuccess(Counter1Key, req) =>
val value = g.get(Counter1Key).value
case NotFound(Counter1Key, req) // key counter1 does not exist
case NotFound(Counter1Key, req) => // key counter1 does not exist
//#get-response1
case unexpected fail("Unexpected response: " + unexpected)
case unexpected => fail("Unexpected response: " + unexpected)
}
probe.expectMsgType[GetResponse[_]] match {
//#get-response2
case g @ GetSuccess(Set1Key, req)
case g @ GetSuccess(Set1Key, req) =>
val elements = g.get(Set1Key).elements
case GetFailure(Set1Key, req)
case GetFailure(Set1Key, req) =>
// read from 3 nodes failed within 1.second
case NotFound(Set1Key, req) // key set1 does not exist
case NotFound(Set1Key, req) => // key set1 does not exist
//#get-response2
case g @ GetSuccess(Set2Key, None)
case g @ GetSuccess(Set2Key, None) =>
val elements = g.get(Set2Key).elements
case unexpected fail("Unexpected response: " + unexpected)
case unexpected => fail("Unexpected response: " + unexpected)
}
}
@ -230,16 +230,16 @@ class DistributedDataDocSpec extends AkkaSpec(DistributedDataDocSpec.config) {
val Counter1Key = PNCounterKey("counter1")
def receive: Receive = {
case "get-count"
case "get-count" =>
// incoming request to retrieve current value of the counter
replicator ! Get(Counter1Key, readTwo, request = Some(sender()))
case g @ GetSuccess(Counter1Key, Some(replyTo: ActorRef))
case g @ GetSuccess(Counter1Key, Some(replyTo: ActorRef)) =>
val value = g.get(Counter1Key).value.longValue
replyTo ! value
case GetFailure(Counter1Key, Some(replyTo: ActorRef))
case GetFailure(Counter1Key, Some(replyTo: ActorRef)) =>
replyTo ! -1L
case NotFound(Counter1Key, Some(replyTo: ActorRef))
case NotFound(Counter1Key, Some(replyTo: ActorRef)) =>
replyTo ! 0L
}
//#get-request-context
@ -259,9 +259,9 @@ class DistributedDataDocSpec extends AkkaSpec(DistributedDataDocSpec.config) {
var currentValue = BigInt(0)
def receive: Receive = {
case c @ Changed(Counter1Key)
case c @ Changed(Counter1Key) =>
currentValue = c.get(Counter1Key).value
case "get-count"
case "get-count" =>
// incoming request to retrieve current value of the counter
sender() ! currentValue
}
@ -306,7 +306,7 @@ class DistributedDataDocSpec extends AkkaSpec(DistributedDataDocSpec.config) {
val m2 = m1.decrement(node, "a", 2)
val m3 = m2.increment(node, "b", 1)
println(m3.get("a")) // 5
m3.entries.foreach { case (key, value) println(s"$key -> $value") }
m3.entries.foreach { case (key, value) => println(s"$key -> $value") }
//#pncountermap
}