YARN-11053. AuxService should not use class name as default system classes (#3816)

Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
Cheng Pan 2021-12-24 10:08:04 +08:00 committed by GitHub
parent d20b598f97
commit 4db27acf06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,7 +240,7 @@ private AuxiliaryService createAuxServiceFromLocalClasspath(
} }
return AuxiliaryServiceWithCustomClassLoader.getInstance(conf, className, return AuxiliaryServiceWithCustomClassLoader.getInstance(conf, className,
appLocalClassPath, getSystemClasses(service, className)); appLocalClassPath, getSystemClasses(service));
} }
/** /**
@ -292,7 +292,7 @@ private AuxiliaryService createAuxService(AuxServiceRecord service,
+ " is using the custom classloader with classpath " + destFiles); + " is using the custom classloader with classpath " + destFiles);
return AuxiliaryServiceWithCustomClassLoader.getInstance(conf, return AuxiliaryServiceWithCustomClassLoader.getInstance(conf,
className, StringUtils.join(File.pathSeparatorChar, destFiles), className, StringUtils.join(File.pathSeparatorChar, destFiles),
getSystemClasses(service, className)); getSystemClasses(service));
} else { } else {
return createAuxServiceFromConfiguration(service); return createAuxServiceFromConfiguration(service);
} }
@ -681,15 +681,12 @@ private static String getClassName(AuxServiceRecord service) {
return serviceConf.getProperty(CLASS_NAME); return serviceConf.getProperty(CLASS_NAME);
} }
private static String[] getSystemClasses(AuxServiceRecord service, String private static String[] getSystemClasses(AuxServiceRecord service) {
className) { AuxServiceConfiguration serviceConf = service.getConfiguration();
AuxServiceConfiguration serviceConf = if (serviceConf == null || serviceConf.getProperty(SYSTEM_CLASSES) == null) {
service.getConfiguration(); return new String[]{};
if (serviceConf == null) {
return new String[]{className};
} }
return StringUtils.split(serviceConf.getProperty(SYSTEM_CLASSES, return StringUtils.split(serviceConf.getProperty(SYSTEM_CLASSES));
className));
} }
/** /**