Fix Spark 2.2 Support (Amending #3062) (#3325)

This pull request amends the broken #3062 allow Spark 2.2 to work.

Please note this won't work in Spark <=2.1 as sc.removeSparkListener was implemented in Spark 2.2. (So perhaps a more general method is better, although that is what was attempted in #3062)

This PR fixes: #3208, #3151 and the discussion in #1927.

I do find it strange that #3062 dose not work in Spark 2.2, it's probably due to some sort of public/private issue in the org.apache.spark.scheduler.LiveListenerBus class inheritance (In Spark itself). The error is: `java.lang.NoSuchMethodError: org.apache.spark.scheduler.LiveListenerBus.removeListener(Ljava/lang/Object;)V`
This commit is contained in:
Mathew 2018-08-13 13:35:20 +12:00 committed by Philip Hyunsu Cho
parent 645996b12f
commit 06ef4db4cc

View File

@ -82,7 +82,7 @@ class SparkParallelismTracker(
try { try {
body body
} finally { } finally {
sc.listenerBus.removeListener(listener) sc.removeSparkListener(listener)
} }
} }