diff --git a/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml b/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml index 09f7f02d39a3b5..bad2bacb1a57bd 100644 --- a/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml +++ b/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml @@ -726,7 +726,8 @@ - + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java index e3c12b54b03d5f..b95e2c31849f6b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java @@ -534,7 +534,8 @@ private void createConfigFileCache(final FileSystem fileSystem) { this.configFileCache = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.MINUTES) .build(new CacheLoader() { - @Override public Object load(ConfigFile key) throws Exception { + @Override + public Object load(ConfigFile key) throws Exception { switch (key.getType()) { case HADOOP_XML: try (FSDataInputStream input = fileSystem @@ -948,10 +949,9 @@ public boolean hasAtLeastOnePlacementConstraint() { } public boolean terminateServiceIfNeeded(Component component) { - boolean serviceIsTerminated = + return terminateServiceIfDominantComponentFinished(component) || terminateServiceIfAllComponentsFinished(); - return serviceIsTerminated; } /** @@ -1039,12 +1039,10 @@ private boolean terminateServiceIfAllComponentsFinished() { } if (shouldTerminate) { - LOG.info("All component finished, exiting Service Master... " - + ", final status={}", (failedComponents.isEmpty() ? "Succeeded" : "Failed")); - LOG.info("Succeeded components: [" + org.apache.commons.lang3.StringUtils - .join(succeededComponents, ",") + "]"); - LOG.info("Failed components: [" + org.apache.commons.lang3.StringUtils - .join(failedComponents, ",") + "]"); + LOG.info("All component finished, exiting Service Master... " + + ", final status={}", (failedComponents.isEmpty() ? "Succeeded" : "Failed")); + LOG.info("Succeeded components: [" + StringUtils.join(succeededComponents, ",") + "]"); + LOG.info("Failed components: [" + StringUtils.join(failedComponents, ",") + "]"); terminateService(failedComponents.isEmpty()); }