Skip to content

Commit

Permalink
YARN-11053. AuxService should not use class name as default system cl…
Browse files Browse the repository at this point in the history
…asses (apache#3816)

Signed-off-by: Akira Ajisaka <[email protected]>
  • Loading branch information
pan3793 authored Dec 24, 2021
1 parent d20b598 commit 4db27ac
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private AuxiliaryService createAuxServiceFromLocalClasspath(
}

return AuxiliaryServiceWithCustomClassLoader.getInstance(conf, className,
appLocalClassPath, getSystemClasses(service, className));
appLocalClassPath, getSystemClasses(service));
}

/**
Expand Down Expand Up @@ -292,7 +292,7 @@ private AuxiliaryService createAuxService(AuxServiceRecord service,
+ " is using the custom classloader with classpath " + destFiles);
return AuxiliaryServiceWithCustomClassLoader.getInstance(conf,
className, StringUtils.join(File.pathSeparatorChar, destFiles),
getSystemClasses(service, className));
getSystemClasses(service));
} else {
return createAuxServiceFromConfiguration(service);
}
Expand Down Expand Up @@ -681,15 +681,12 @@ private static String getClassName(AuxServiceRecord service) {
return serviceConf.getProperty(CLASS_NAME);
}

private static String[] getSystemClasses(AuxServiceRecord service, String
className) {
AuxServiceConfiguration serviceConf =
service.getConfiguration();
if (serviceConf == null) {
return new String[]{className};
private static String[] getSystemClasses(AuxServiceRecord service) {
AuxServiceConfiguration serviceConf = service.getConfiguration();
if (serviceConf == null || serviceConf.getProperty(SYSTEM_CLASSES) == null) {
return new String[]{};
}
return StringUtils.split(serviceConf.getProperty(SYSTEM_CLASSES,
className));
return StringUtils.split(serviceConf.getProperty(SYSTEM_CLASSES));
}

/**
Expand Down

0 comments on commit 4db27ac

Please sign in to comment.