hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [37/49] hadoop git commit: YARN-8997. [Submarine] Small refactors of modifier, condition check and redundant local variables. Contributed by Zhankun Tang.
Date Tue, 13 Nov 2018 07:51:04 GMT
YARN-8997. [Submarine] Small refactors of modifier, condition check and redundant local variables.
Contributed by Zhankun Tang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e269c3fb
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e269c3fb
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e269c3fb

Branch: refs/heads/HDFS-13891
Commit: e269c3fb5a938e4359232628175569dbbd1a12c1
Parents: f944f33
Author: Giovanni Matteo Fumarola <gifuma@apache.org>
Authored: Mon Nov 12 15:06:43 2018 -0800
Committer: Giovanni Matteo Fumarola <gifuma@apache.org>
Committed: Mon Nov 12 15:06:43 2018 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/yarn/submarine/client/cli/CliUtils.java  | 4 +---
 .../submarine/runtimes/common/FSBasedSubmarineStorageImpl.java | 6 ++----
 .../submarine/runtimes/yarnservice/YarnServiceJobMonitor.java  | 3 +--
 .../runtimes/yarnservice/YarnServiceJobSubmitter.java          | 5 +----
 .../yarn/submarine/runtimes/yarnservice/YarnServiceUtils.java  | 4 +---
 5 files changed, 6 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e269c3fb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/client/cli/CliUtils.java
----------------------------------------------------------------------
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 546c6eb..05e830f 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;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e269c3fb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/common/FSBasedSubmarineStorageImpl.java
----------------------------------------------------------------------
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 767fe78..1881510 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<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");
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e269c3fb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobMonitor.java
----------------------------------------------------------------------
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 94d30b0..fab018a 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);
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e269c3fb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceJobSubmitter.java
----------------------------------------------------------------------
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 d57c675..bcd4698 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,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e269c3fb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-submarine/src/main/java/org/apache/hadoop/yarn/submarine/runtimes/yarnservice/YarnServiceUtils.java
----------------------------------------------------------------------
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 d69840a..ce3a1eb 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,


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message