YARN-8997. [Submarine] Small refactors of modifier, condition check and redundant local variables. Contributed by Zhankun Tang.
This commit is contained in:
parent
f944f33832
commit
e269c3fb5a
|
@ -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;
|
||||
|
|
|
@ -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<String, String> 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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue