You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bahir.apache.org by ck...@apache.org on 2017/02/27 11:40:44 UTC
bahir git commit: [MINOR] Code Style Fixes for Akka Example
Repository: bahir
Updated Branches:
refs/heads/master daf001fd6 -> 8d46b3961
[MINOR] Code Style Fixes for Akka Example
* mutable LinkedHashSet must be prefixed
* use interpolated string formatting
Closes #36
Project: http://git-wip-us.apache.org/repos/asf/bahir/repo
Commit: http://git-wip-us.apache.org/repos/asf/bahir/commit/8d46b396
Tree: http://git-wip-us.apache.org/repos/asf/bahir/tree/8d46b396
Diff: http://git-wip-us.apache.org/repos/asf/bahir/diff/8d46b396
Branch: refs/heads/master
Commit: 8d46b396142624f40ab0359c7fb2407cb7f06951
Parents: daf001f
Author: Scott Walker <sc...@digital.hmrc.gov.uk>
Authored: Thu Feb 23 14:13:12 2017 +0000
Committer: Christian Kadner <ck...@us.ibm.com>
Committed: Mon Feb 27 03:39:37 2017 -0800
----------------------------------------------------------------------
.../spark/examples/streaming/akka/ActorWordCount.scala | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bahir/blob/8d46b396/streaming-akka/examples/src/main/scala/org/apache/spark/examples/streaming/akka/ActorWordCount.scala
----------------------------------------------------------------------
diff --git a/streaming-akka/examples/src/main/scala/org/apache/spark/examples/streaming/akka/ActorWordCount.scala b/streaming-akka/examples/src/main/scala/org/apache/spark/examples/streaming/akka/ActorWordCount.scala
index 4af5d94..3a06da8 100644
--- a/streaming-akka/examples/src/main/scala/org/apache/spark/examples/streaming/akka/ActorWordCount.scala
+++ b/streaming-akka/examples/src/main/scala/org/apache/spark/examples/streaming/akka/ActorWordCount.scala
@@ -18,7 +18,7 @@
// scalastyle:off println
package org.apache.spark.examples.streaming.akka
-import scala.collection.mutable.LinkedHashSet
+import scala.collection.mutable
import scala.util.Random
import akka.actor.{Props, _}
@@ -39,7 +39,7 @@ case class UnsubscribeReceiver(receiverActor: ActorRef)
class FeederActor extends Actor {
val rand = new Random()
- val receivers = new LinkedHashSet[ActorRef]()
+ val receivers = new mutable.LinkedHashSet[ActorRef]()
val strings: Array[String] = Array("words ", "may ", "count ")
@@ -62,11 +62,11 @@ class FeederActor extends Actor {
def receive: Receive = {
case SubscribeReceiver(receiverActor: ActorRef) =>
- println("received subscribe from %s".format(receiverActor.toString))
+ println(s"received subscribe from ${receiverActor.toString}")
receivers += receiverActor
case UnsubscribeReceiver(receiverActor: ActorRef) =>
- println("received unsubscribe from %s".format(receiverActor.toString))
+ println(s"received unsubscribe from ${receiverActor.toString}")
receivers -= receiverActor
}
}
@@ -172,7 +172,7 @@ object ActorWordCount {
val lines = AkkaUtils.createStream[String](
ssc,
Props(classOf[SampleActorReceiver[String]],
- "akka.tcp://test@%s:%s/user/FeederActor".format(host, port.toInt)),
+ s"akka.tcp://test@$host:${port.toInt}/user/FeederActor"),
"SampleReceiver")
// compute wordcount