/** * Creates a new instance for the following set of {@link URL}. * * @param urls the URLs from which to load classes and resources * @param parent the parent classloader for delegation */ public SparkContainerClassLoader(URL[] urls, ClassLoader parent) { super(urls, parent); this.sparkClassRewriter = new SparkClassRewriter(name -> ClassLoaders.openResource(this, name), false); }
public SparkRunnerClassLoader(URL[] urls, @Nullable ClassLoader parent, boolean rewriteYarnClient) { super(urls, parent); // Copy from URLClassLoader, which also uses WeakHashMap this.closeables = new WeakHashMap<>(); this.closeablesLock = new ReentrantLock(); this.rewriter = new SparkClassRewriter(name -> ClassLoaders.openResource(this, name), rewriteYarnClient); }
/** * Creates a new instance for the following set of {@link URL}. * * @param urls the URLs from which to load classes and resources * @param parent the parent classloader for delegation */ public SparkContainerClassLoader(URL[] urls, ClassLoader parent) { super(urls, parent); this.sparkClassRewriter = new SparkClassRewriter(name -> ClassLoaders.openResource(this, name), false); }
public SparkRunnerClassLoader(URL[] urls, @Nullable ClassLoader parent, boolean rewriteYarnClient) { super(urls, parent); // Copy from URLClassLoader, which also uses WeakHashMap this.closeables = new WeakHashMap<>(); this.closeablesLock = new ReentrantLock(); this.rewriter = new SparkClassRewriter(name -> ClassLoaders.openResource(this, name), rewriteYarnClient); }
public SparkRunnerClassLoader(URL[] urls, @Nullable ClassLoader parent, boolean rewriteYarnClient) { super(urls, parent); // Copy from URLClassLoader, which also uses WeakHashMap this.closeables = new WeakHashMap<>(); this.closeablesLock = new ReentrantLock(); this.rewriter = new SparkClassRewriter(name -> ClassLoaders.openResource(this, name), rewriteYarnClient); }
/** * Creates a new instance for the following set of {@link URL}. * * @param urls the URLs from which to load classes and resources * @param parent the parent classloader for delegation */ public SparkContainerClassLoader(URL[] urls, ClassLoader parent) { super(urls, parent); this.sparkClassRewriter = new SparkClassRewriter(name -> ClassLoaders.openResource(this, name), false); }
try (InputStream is = ClassLoaders.openResource(this, name.replace('.', '/') + ".class")) { if (is == null) { throw new ClassNotFoundException("Failed to find resource for class " + name);
try (InputStream is = ClassLoaders.openResource(this, name.replace('.', '/') + ".class")) { if (is == null) { throw new ClassNotFoundException("Failed to find resource for class " + name);
try (InputStream is = ClassLoaders.openResource(this, name.replace('.', '/') + ".class")) { if (is == null) { throw new ClassNotFoundException("Failed to find resource for class " + name);