Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-13177][Examples]Update ActorWordCount example to not directly use low level linked list as it is deprecated. #11113

Closed
wants to merge 8 commits into from

Conversation

agsachin
Copy link
Contributor

@agsachin agsachin commented Feb 8, 2016

No description provided.

import org.apache.spark.streaming.akka.{ActorReceiver, AkkaUtils}
import org.apache.spark.streaming.{Seconds, StreamingContext}

import scala.collection.mutable._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports were in the right place before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry , will fix that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any configuration file which I can import so that intellij uses recommended settings as default ?

@agsachin
Copy link
Contributor Author

agsachin commented Feb 8, 2016

@srowen if this is ok can u ask jenkins to test..

@@ -39,7 +39,7 @@ case class UnsubscribeReceiver(receiverActor: ActorRef)
class FeederActor extends Actor {

val rand = new Random()
var receivers: LinkedList[ActorRef] = new LinkedList[ActorRef]()
var receivers: ArrayBuffer[ActorRef] = new ArrayBuffer[ActorRef]()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could just be var receivers =ArrayBuffer[ActorRef](). In fact it can be a val; the one other assignment in the line with dropWhile is pointless for a mutable collection.

I suppose one could argue we should be using some form of linked list with O(1) insertion at the head, but given it's an example, I'm not so worried.

@agsachin
Copy link
Contributor Author

agsachin commented Feb 8, 2016

@srowen , I agree with you on Linked List front, just thinking to keep example simple

@zsxwing
Copy link
Member

zsxwing commented Feb 8, 2016

ok to test

@@ -39,7 +39,7 @@ case class UnsubscribeReceiver(receiverActor: ActorRef)
class FeederActor extends Actor {

val rand = new Random()
var receivers: LinkedList[ActorRef] = new LinkedList[ActorRef]()
val receivers = new ArrayBuffer[ActorRef]()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a mutable Set be a better fit here? It seems that receivers is used to hold distinct ActorRefs

@SparkQA
Copy link

SparkQA commented Feb 8, 2016

Test build #50934 has finished for PR 11113 at commit 06273fc.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 8, 2016

Test build #50944 has finished for PR 11113 at commit f38d7b6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jodersky
Copy link
Member

jodersky commented Feb 8, 2016

lgtm

@srowen
Copy link
Member

srowen commented Feb 9, 2016

Merged to master

@asfgit asfgit closed this in d9ba4d2 Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants