public class HdfsClassLoader extends ClassLoader
ClassLoader that reads its class data from a jar file stored in HDFS.| Modifier and Type | Field and Description |
|---|---|
static String |
ATTEMPT_LOCAL_LOAD_FIRST
A configuration option to indicate whether or not to skip the standard
ClassLoader hierarchical
search and look at the configured jar first. |
| Constructor and Description |
|---|
HdfsClassLoader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path jar) |
| Modifier and Type | Method and Description |
|---|---|
Class |
findClass(String className)
Search for the class in the configured jar file stored in HDFS.
|
Class |
loadClass(String className)
Override to allow for checking the local jar first instead of the standard search which would check
the parent class loader first.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic static final String ATTEMPT_LOCAL_LOAD_FIRST
ClassLoader hierarchical
search and look at the configured jar first. Defaults to false so that the standard search is performed,
but it may be helpful to turn to true for debugging.public HdfsClassLoader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path jar)
configuration - The Hadoop configuration to use to read from HDFSjar - A path to a jar file containing classes to loadpublic Class loadClass(String className) throws ClassNotFoundException
loadClass in class ClassLoaderClassNotFoundExceptionpublic Class findClass(String className) throws ClassNotFoundException
findClass in class ClassLoaderClassNotFoundExceptionCopyright © 2020. All rights reserved.