raw.compiler.jvm.RawMutableURLClassLoader.scala Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2023 RAW Labs S.A.
*
* Use of this software is governed by the Business Source License
* included in the file licenses/BSL.txt.
*
* As of the Change Date specified in that file, in accordance with
* the Business Source License, use of this software will be governed
* by the Apache License, Version 2.0, included in the file
* licenses/APL.txt.
*/
package raw.compiler.jvm
import com.typesafe.scalalogging.StrictLogging
import java.net.{URL, URLClassLoader}
/**
* Used to load the classes generated by the query compiler. It is important to use the same
* classloader whenever the query classes are loaded, which includes in the ExecutionServer class
* and in the Spark executors. Therefore, the same instance of RawMutableURLClassLoader should be
* used as a parent to the classloader that Spark creates internally (by setting it as
* Thread.contextClassloader) and by the execution server.
*/
class RawMutableURLClassLoader(parent: ClassLoader, urls: Array[URL] = new Array(0))
extends URLClassLoader(urls, parent)
with StrictLogging {
override def addURL(url: URL): Unit = {
logger.debug("Adding URL: " + url)
super.addURL(url)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy