YARN-8997. [Submarine] Small refactors of modifier, condition check and redundant local variables. Contributed by Zhankun Tang.

This commit is contained in:
Giovanni Matteo Fumarola 2018-11-12 15:06:43 -08:00
parent f944f33832
commit e269c3fb5a
5 changed files with 6 additions and 16 deletions

View File

@ -156,9 +156,7 @@ public class CliUtils {
return true; return true;
if (args.length == 1) { if (args.length == 1) {
if (args[0].equals("-h") || args[0].equals("--help")) { return args[0].equals("-h") || args[0].equals("--help");
return true;
}
} }
return false; return false;

View File

@ -73,8 +73,7 @@ public class FSBasedSubmarineStorageImpl extends SubmarineStorage {
private Path getModelInfoPath(String modelName, String version, boolean create) private Path getModelInfoPath(String modelName, String version, boolean create)
throws IOException { throws IOException {
Path modelDir = rdm.getModelDir(modelName, create); Path modelDir = rdm.getModelDir(modelName, create);
Path modelInfo = new Path(modelDir, version + ".info"); return new Path(modelDir, version + ".info");
return modelInfo;
} }
private void serializeMap(FSDataOutputStream fos, Map<String, String> map) private void serializeMap(FSDataOutputStream fos, Map<String, String> map)
@ -98,7 +97,6 @@ public class FSBasedSubmarineStorageImpl extends SubmarineStorage {
private Path getJobInfoPath(String jobName, boolean create) throws IOException { private Path getJobInfoPath(String jobName, boolean create) throws IOException {
Path path = rdm.getJobStagingArea(jobName, create); Path path = rdm.getJobStagingArea(jobName, create);
Path fileName = new Path(path, "job.info"); return new Path(path, "job.info");
return fileName;
} }
} }

View File

@ -40,7 +40,6 @@ public class YarnServiceJobMonitor extends JobMonitor {
} }
Service serviceSpec = this.serviceClient.getStatus(jobName); Service serviceSpec = this.serviceClient.getStatus(jobName);
JobStatus jobStatus = JobStatusBuilder.fromServiceSpec(serviceSpec); return JobStatusBuilder.fromServiceSpec(serviceSpec);
return jobStatus;
} }
} }

View File

@ -103,10 +103,7 @@ public class YarnServiceJobSubmitter implements JobSubmitter {
} }
private boolean needHdfs(String content) { private boolean needHdfs(String content) {
if (content != null && content.contains("hdfs://")) { return content != null && content.contains("hdfs://");
return true;
}
return false;
} }
private void addHdfsClassPathIfNeeded(RunJobParameters parameters, private void addHdfsClassPathIfNeeded(RunJobParameters parameters,

View File

@ -58,9 +58,7 @@ public class YarnServiceUtils {
private static String getDNSNameCommonSuffix(String serviceName, private static String getDNSNameCommonSuffix(String serviceName,
String userName, String domain, int port) { String userName, String domain, int port) {
String commonEndpointSuffix = return "." + serviceName + "." + userName + "." + domain + ":" + port;
"." + serviceName + "." + userName + "." + domain + ":" + port;
return commonEndpointSuffix;
} }
public static String getTFConfigEnv(String curCommponentName, int nWorkers, public static String getTFConfigEnv(String curCommponentName, int nWorkers,