register class bu name, because it doesn't exist in all Spark versions
@@ -33,8 +33,14 @@ class KryoRegistrar extends KryoRegistrator {
kryo.register(classOf[Array[Long]])
kryo.register(Class.forName("org.apache.spark.util.BoundedPriorityQueue"))
+
// this class is missing in Spark 2.2.0 (see https://issues.apache.org/jira/browse/SPARK-21569)
- kryo.register(classOf[org.apache.spark.internal.io.FileCommitProtocol.TaskCommitMessage])
+ try {
+ kryo.register(Class.forName("org.apache.spark.internal.io.FileCommitProtocol$TaskCommitMessage"))
+ }
+ catch {
+ case _:Throwable =>
+ }
}
}
