I am starting to use Spark Streaming to process the real-time data feed that I receive. My scenario is that I have an Akka Accor Receiver using "with ActorHelper", then I have a Spark job doing some transformations and transformations, and then I want to send the result to another actor.
My problem is the last part. When trying to send to another actor, Spark throws an exception:
02/15/20 16:43:16 WARN TaskSetManager: lost task 0.0 in step 2.0 (TID 2, localhost): java.lang.IllegalStateException: attempt to deserialize a serialized ActorRef without using the ActorSystem system. Use 'akka.serialization.Serialization.currentSystem.withValue (system) {...}'
I create this last actor as follows:
val actorSystem = SparkEnv.get.actorSystem val lastActor = actorSystem.actorOf(MyLastActor.props(someParam), "MyLastActor")
And then using it like this:
result.foreachRDD(rdd => rdd.foreachPartition(lastActor ! _))
Iβm not sure where and how to make the βUseβ advice akka.serialization.Serialization.currentSystem.withValue (system) {...} '". Do I need to install any special configuration? Or create my actor differently?
source share