-
Notifications
You must be signed in to change notification settings - Fork 28k
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
Conversation
import org.apache.spark.streaming.akka.{ActorReceiver, AkkaUtils} | ||
import org.apache.spark.streaming.{Seconds, StreamingContext} | ||
|
||
import scala.collection.mutable._ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry , will fix that
There was a problem hiding this comment.
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 ?
@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]() |
There was a problem hiding this comment.
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.
@srowen , I agree with you on Linked List front, just thinking to keep example simple |
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]() |
There was a problem hiding this comment.
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
Test build #50934 has finished for PR 11113 at commit
|
Test build #50944 has finished for PR 11113 at commit
|
lgtm |
Merged to master |
No description provided.