Skip to content

Commit

Permalink
YARN-11711. Fix CheckStyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
slfan1989 committed Aug 17, 2024
1 parent 5a42a87 commit b439229
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,8 @@
<Package name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.placement.schema" />
</Match>

<!-- The called method signature is public boolean set(@Nullable V value) in guava 27, so this should be ignored -->
<!-- The ServiceScheduler#createConfigFileCache method uses the `load` method,
which is not allowed to return null; we can ignore it here. -->
<Match>
<Class name="org.apache.hadoop.yarn.service.ServiceScheduler"/>
<Method name="$1.load(ConfigFile)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ private void createConfigFileCache(final FileSystem fileSystem) {
this.configFileCache =
CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.MINUTES)
.build(new CacheLoader<ConfigFile, Object>() {
@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
Expand Down Expand Up @@ -948,10 +949,9 @@ public boolean hasAtLeastOnePlacementConstraint() {
}

public boolean terminateServiceIfNeeded(Component component) {
boolean serviceIsTerminated =
return
terminateServiceIfDominantComponentFinished(component) ||
terminateServiceIfAllComponentsFinished();
return serviceIsTerminated;
}

/**
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit b439229

Please sign in to comment.