Github user mridulm commented on a diff in the pull request:
https://github.com/apache/spark/pull/22192#discussion_r216116706
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -240,6 +240,19 @@ private[spark] object Utils extends Logging {
// scalastyle:on classforname
}
+ /**
+ * Run a segment of code using a different context class loader in the
current thread
+ */
+ def withContextClassLoader[T](ctxClassLoader: ClassLoader)(fn: => T): T
= {
+ val oldClassLoader = getContextOrSparkClassLoader
--- End diff --
Curious, why `getContextOrSparkClassLoader` and not just
`Thread.getContextClassLoader` ?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]