@Experimental @Internal public class ClientWrapperClassLoader extends FlinkUserCodeClassLoaders.SafetyNetWrapperClassLoader
FlinkUserCodeClassLoaders.SafetyNetWrapperClassLoader
, upon the addURL
method, it
also exposes a removeURL
method which used to remove unnecessary jar from current
classloader path. This class loader wraps a FlinkUserCodeClassLoader
and an old
classloader list, the class load is delegated to the inner FlinkUserCodeClassLoader
.
This is only used to SqlClient for supporting REMOVE JAR
clause currently. When remove
a jar, get the registered jar url list from current FlinkUserCodeClassLoader
firstly,
then create a new instance of FlinkUserCodeClassLoader
which urls doesn't include the
removed jar, and the currentClassLoader point to new instance object, the old object is added to
list to be closed when close ClientWrapperClassLoader
.
Note: This classloader is not guaranteed to actually remove class or resource, any classes or resources in the removed jar that are already loaded, are still accessible.
inner
Constructor and Description |
---|
ClientWrapperClassLoader(FlinkUserCodeClassLoader inner,
Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
removeURL(URL url) |
addURL, getResource, getResources, getURLs, loadClass, loadClass
definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ClientWrapperClassLoader(FlinkUserCodeClassLoader inner, Configuration configuration)
public void removeURL(URL url)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class FlinkUserCodeClassLoaders.SafetyNetWrapperClassLoader
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.