Skip to content

Commit 7b51e68

Browse files
pan3793aajisaka
authored andcommitted
YARN-11053. AuxService should not use class name as default system classes (#3816)
Signed-off-by: Akira Ajisaka <[email protected]> (cherry picked from commit 4db27ac)
1 parent 6c252cf commit 7b51e68

File tree

1 file changed

+7
-10
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager

1 file changed

+7
-10
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/AuxServices.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private AuxiliaryService createAuxServiceFromLocalClasspath(
240240
}
241241

242242
return AuxiliaryServiceWithCustomClassLoader.getInstance(conf, className,
243-
appLocalClassPath, getSystemClasses(service, className));
243+
appLocalClassPath, getSystemClasses(service));
244244
}
245245

246246
/**
@@ -292,7 +292,7 @@ private AuxiliaryService createAuxService(AuxServiceRecord service,
292292
+ " is using the custom classloader with classpath " + destFiles);
293293
return AuxiliaryServiceWithCustomClassLoader.getInstance(conf,
294294
className, StringUtils.join(File.pathSeparatorChar, destFiles),
295-
getSystemClasses(service, className));
295+
getSystemClasses(service));
296296
} else {
297297
return createAuxServiceFromConfiguration(service);
298298
}
@@ -681,15 +681,12 @@ private static String getClassName(AuxServiceRecord service) {
681681
return serviceConf.getProperty(CLASS_NAME);
682682
}
683683

684-
private static String[] getSystemClasses(AuxServiceRecord service, String
685-
className) {
686-
AuxServiceConfiguration serviceConf =
687-
service.getConfiguration();
688-
if (serviceConf == null) {
689-
return new String[]{className};
684+
private static String[] getSystemClasses(AuxServiceRecord service) {
685+
AuxServiceConfiguration serviceConf = service.getConfiguration();
686+
if (serviceConf == null || serviceConf.getProperty(SYSTEM_CLASSES) == null) {
687+
return new String[]{};
690688
}
691-
return StringUtils.split(serviceConf.getProperty(SYSTEM_CLASSES,
692-
className));
689+
return StringUtils.split(serviceConf.getProperty(SYSTEM_CLASSES));
693690
}
694691

695692
/**

0 commit comments

Comments
 (0)