diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/client/cli/CliUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/client/cli/CliUtils.java index 546c6ebbbf..05e830f50d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/client/cli/CliUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/client/cli/CliUtils.java @@ -156,9 +156,7 @@ public class CliUtils { return true; if (args.length == 1) { - if (args[0].equals("-h") || args[0].equals("--help")) { - return true; - } + return args[0].equals("-h") || args[0].equals("--help"); } return false; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/common/FSBasedSubmarineStorageImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/common/FSBasedSubmarineStorageImpl.java index 767fe78fc3..18815107ff 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/common/FSBasedSubmarineStorageImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/common/FSBasedSubmarineStorageImpl.java @@ -73,8 +73,7 @@ public class FSBasedSubmarineStorageImpl extends SubmarineStorage { private Path getModelInfoPath(String modelName, String version, boolean create) throws IOException { Path modelDir = rdm.getModelDir(modelName, create); - Path modelInfo = new Path(modelDir, version + ".info"); - return modelInfo; + return new Path(modelDir, version + ".info"); } private void serializeMap(FSDataOutputStream fos, Map map) @@ -98,7 +97,6 @@ public class FSBasedSubmarineStorageImpl extends SubmarineStorage { private Path getJobInfoPath(String jobName, boolean create) throws IOException { Path path = rdm.getJobStagingArea(jobName, create); - Path fileName = new Path(path, "job.info"); - return fileName; + return new Path(path, "job.info"); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobMonitor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobMonitor.java index 94d30b030f..fab018a900 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobMonitor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobMonitor.java @@ -40,7 +40,6 @@ public class YarnServiceJobMonitor extends JobMonitor { } Service serviceSpec = this.serviceClient.getStatus(jobName); - JobStatus jobStatus = JobStatusBuilder.fromServiceSpec(serviceSpec); - return jobStatus; + return JobStatusBuilder.fromServiceSpec(serviceSpec); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java index d57c675dee..bcd4698f91 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java @@ -103,10 +103,7 @@ public class YarnServiceJobSubmitter implements JobSubmitter { } private boolean needHdfs(String content) { - if (content != null && content.contains("hdfs://")) { - return true; - } - return false; + return content != null && content.contains("hdfs://"); } private void addHdfsClassPathIfNeeded(RunJobParameters parameters, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceUtils.java index d69840abb9..ce3a1eb1b3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceUtils.java @@ -58,9 +58,7 @@ public class YarnServiceUtils { private static String getDNSNameCommonSuffix(String serviceName, String userName, String domain, int port) { - String commonEndpointSuffix = - "." + serviceName + "." + userName + "." + domain + ":" + port; - return commonEndpointSuffix; + return "." + serviceName + "." + userName + "." + domain + ":" + port; } public static String getTFConfigEnv(String curCommponentName, int nWorkers,