class MyActor extends Actor with Receiver{
def receive {
case anything :String ¬ヌメ pushBlock(anything)
}
}
//Can be plugged in actorStream as follows
ssc.actorStream[String](Props(new MyActor),"MyActorReceiver")
Note
An important point to note:
Since Actor may exist outside the spark framework, It is thus user's responsibility
to ensure the type safety, i.e parametrized type of push block and InputDStream
should be same.
A receiver trait to be mixed in with your Actor to gain access to pushBlock API.
Find more details at: http://spark-project.org/docs/latest/streaming-custom-receivers.html
An important point to note: Since Actor may exist outside the spark framework, It is thus user's responsibility to ensure the type safety, i.e parametrized type of push block and InputDStream should be same.