hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jia...@apache.org
Subject hadoop git commit: YARN-5796. Convert enums values in service code to upper case and special handling of an error. Contributed by Gour Saha
Date Tue, 01 Nov 2016 17:59:51 GMT
Repository: hadoop
Updated Branches:
  refs/heads/yarn-native-services e36547777 -> 4c015402a


YARN-5796. Convert enums values in service code to upper case and special handling of an error.
Contributed by Gour Saha


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

Branch: refs/heads/yarn-native-services
Commit: 4c015402ae4cb9e27b0896fc3cdd65041ccacd56
Parents: e365477
Author: Jian He <jianhe@apache.org>
Authored: Tue Nov 1 11:00:11 2016 -0700
Committer: Jian He <jianhe@apache.org>
Committed: Tue Nov 1 11:00:11 2016 -0700

----------------------------------------------------------------------
 .../yarn/services/api/impl/ApplicationApiService.java     |  4 ++++
 .../apache/hadoop/yarn/services/resource/Artifact.java    |  2 +-
 .../apache/hadoop/yarn/services/resource/ConfigFile.java  |  4 ++--
 .../hadoop/yarn/services/resource/ReadinessCheck.java     |  2 +-
 .../hadoop/yarn/services/utils/RestApiErrorMessages.java  | 10 +++++++---
 5 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4c015402/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
index cf43ac2..37bd134 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
@@ -172,6 +172,10 @@ public class ApplicationApiService implements ApplicationApi {
         applicationStatus.setDiagnostics(ERROR_APPLICATION_IN_USE);
         return Response.status(Status.BAD_REQUEST).entity(applicationStatus)
             .build();
+      } else if (se.getExitCode() == SliderExitCodes.EXIT_INSTANCE_EXISTS) {
+        applicationStatus.setDiagnostics(ERROR_APPLICATION_INSTANCE_EXISTS);
+        return Response.status(Status.BAD_REQUEST).entity(applicationStatus)
+            .build();
       } else {
         applicationStatus.setDiagnostics(se.getMessage());
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4c015402/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Artifact.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Artifact.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Artifact.java
index 9ac2bc7..87fcf89 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Artifact.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Artifact.java
@@ -40,7 +40,7 @@ public class Artifact implements Serializable {
   private String id = null;
 
   public enum TypeEnum {
-    DOCKER("docker"), TARBALL("tarball"), APPLICATION("application");
+    DOCKER("DOCKER"), TARBALL("TARBALL"), APPLICATION("APPLICATION");
 
     private String value;
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4c015402/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ConfigFile.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ConfigFile.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ConfigFile.java
index 3ced153..01d976f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ConfigFile.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ConfigFile.java
@@ -43,8 +43,8 @@ public class ConfigFile implements Serializable {
   private static final long serialVersionUID = -7009402089417704612L;
 
   public enum TypeEnum {
-    XML("xml"), PROPERTIES("properties"), JSON("json"), YAML("yaml"), TEMPLATE(
-        "template"), ENV("env"), HADOOP_XML("hadoop_xml");
+    XML("XML"), PROPERTIES("PROPERTIES"), JSON("JSON"), YAML("YAML"), TEMPLATE(
+        "TEMPLATE"), ENV("ENV"), HADOOP_XML("HADOOP_XML");
 
     private String value;
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4c015402/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ReadinessCheck.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ReadinessCheck.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ReadinessCheck.java
index f549746..26cd39a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ReadinessCheck.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ReadinessCheck.java
@@ -39,7 +39,7 @@ public class ReadinessCheck implements Serializable {
   private static final long serialVersionUID = -3836839816887186801L;
 
   public enum TypeEnum {
-    HTTP("http");
+    HTTP("HTTP");
 
     private String value;
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4c015402/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/utils/RestApiErrorMessages.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/utils/RestApiErrorMessages.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/utils/RestApiErrorMessages.java
index 685f85a..2d739a4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/utils/RestApiErrorMessages.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/utils/RestApiErrorMessages.java
@@ -26,6 +26,11 @@ public interface RestApiErrorMessages {
 
   String ERROR_APPLICATION_NOT_RUNNING = "Application not running";
   String ERROR_APPLICATION_DOES_NOT_EXIST = "Application not found";
+  String ERROR_APPLICATION_IN_USE = "Application already exists in started"
+      + " state";
+  String ERROR_APPLICATION_INSTANCE_EXISTS = "Application already exists in"
+      + " stopped/failed state (either restart with PUT or destroy with DELETE"
+      + " before creating a new one)";
 
   String ERROR_SUFFIX_FOR_COMPONENT =
       " for component %s (nor at the global level)";
@@ -66,7 +71,6 @@ public interface RestApiErrorMessages {
   String ERROR_RESOURCE_PROFILE_NOT_SUPPORTED_YET =
       "Resource profile is not " + "supported yet. Please specify cpus/memory.";
 
-  String ERROR_APPLICATION_IN_USE = "Application name is already in use";
   String ERROR_NULL_ARTIFACT_ID =
       "Artifact Id can not be null if artifact type is none";
   String ERROR_ABSENT_NUM_OF_INSTANCE =
@@ -74,6 +78,6 @@ public interface RestApiErrorMessages {
   String ERROR_ABSENT_LAUNCH_COMMAND =
       "launch command should appear if type is slider-zip or none";
 
-  String ERROR_QUICKLINKS_FOR_COMP_INVALID =
-      "Quicklinks specified at component level, needs corresponding values set at application
level";
+  String ERROR_QUICKLINKS_FOR_COMP_INVALID = "Quicklinks specified at"
+      + " component level, needs corresponding values set at application level";
 }


---------------------------------------------------------------------
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