public interface SparkClassUtils
Modifier and Type | Method and Description |
---|---|
<C> Class<C> |
classForName(String className,
boolean initialize,
boolean noSparkClassLoader)
Preferred alternative to Class.forName(className), as well as
Class.forName(className, initialize, loader) with current thread's ContextClassLoader.
|
boolean |
classIsLoadable(String clazz)
Determines whether the provided class is loadable in the current thread.
|
ClassLoader |
getContextOrSparkClassLoader() |
ClassLoader |
getSparkClassLoader() |
boolean |
isMemberClass(Class<?> cls)
Returns true if and only if the underlying class is a member class.
|
java.util.Random |
random() |
java.util.Random random()
ClassLoader getSparkClassLoader()
ClassLoader getContextOrSparkClassLoader()
<C> Class<C> classForName(String className, boolean initialize, boolean noSparkClassLoader)
className
- (undocumented)initialize
- (undocumented)noSparkClassLoader
- (undocumented)boolean classIsLoadable(String clazz)
boolean isMemberClass(Class<?> cls)
Note: jdk8u throws a "Malformed class name" error if a given class is a deeply-nested inner class (See SPARK-34607 for details). This issue has already been fixed in jdk9+, so we can remove this helper method safely if we drop the support of jdk8u.
cls
- (undocumented)