-
- Downloads
[SPARK-5569][STREAMING] fix ObjectInputStreamWithLoader for supporting load array classes.
When use Kafka DirectStream API to create checkpoint and restore saved checkpoint when restart, ClassNotFound exception would occur. The reason for this error is that ObjectInputStreamWithLoader extends the ObjectInputStream class and override its resolveClass method. But Instead of Using Class.forName(desc,false,loader), Spark uses loader.loadClass(desc) to instance the class, which do not works with array class. For example: Class.forName("[Lorg.apache.spark.streaming.kafka.OffsetRange.",false,loader) works well while loader.loadClass("[Lorg.apache.spark.streaming.kafka.OffsetRange") would throw an class not found exception. details of the difference between Class.forName and loader.loadClass can be found here. http://bugs.java.com/view_bug.do?bug_id=6446627 Author: maxwell <maxwellzdm@gmail.com> Author: DEMING ZHU <deming.zhu@linecorp.com> Closes #8955 from maxwellzdm/master.
Showing
- streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala 3 additions, 1 deletion...rc/main/scala/org/apache/spark/streaming/Checkpoint.scala
- streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala 33 additions, 2 deletions...st/scala/org/apache/spark/streaming/CheckpointSuite.scala
Please register or sign in to comment