You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ji...@apache.org on 2016/10/12 20:33:29 UTC

hadoop git commit: Addendum patch for YARN-5610. Contributed by Gour Saha

Repository: hadoop
Updated Branches:
  refs/heads/yarn-native-services 5be4c0735 -> 42083da04


Addendum patch for YARN-5610. 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/42083da0
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/42083da0
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/42083da0

Branch: refs/heads/yarn-native-services
Commit: 42083da0465a5cfd23e265e58e532b0a8ba541cd
Parents: 5be4c07
Author: Jian He <ji...@apache.org>
Authored: Wed Oct 12 13:33:09 2016 -0700
Committer: Jian He <ji...@apache.org>
Committed: Wed Oct 12 13:33:09 2016 -0700

----------------------------------------------------------------------
 .../yarn/services/resource/Application.java     | 44 ++++++++++----------
 .../services/resource/ApplicationState.java     |  5 +++
 .../services/resource/ApplicationStatus.java    |  8 ++--
 .../hadoop/yarn/services/resource/Artifact.java |  4 +-
 .../yarn/services/resource/Component.java       | 16 +++----
 .../yarn/services/resource/Container.java       | 15 ++++---
 .../yarn/services/resource/ReadinessCheck.java  |  6 +--
 7 files changed, 54 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/42083da0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Application.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/Application.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Application.java
index cfcae95..719bf95 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Application.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Application.java
@@ -48,8 +48,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 public class Application extends BaseResource {
   private static final long serialVersionUID = -4491694636566094885L;
 
-  private String id = null;
   private String name = null;
+  private String id = null;
   private Artifact artifact = null;
   private Resource resource = null;
   private String launchCommand = null;
@@ -63,25 +63,7 @@ public class Application extends BaseResource {
   private List<Container> containers = new ArrayList<>();
   private ApplicationState state = null;
   private Map<String, String> quicklinks = null;
-  private String queue;
-
-  /**
-   * A unique application id.
-   **/
-  public Application id(String id) {
-    this.id = id;
-    return this;
-  }
-
-  @ApiModelProperty(example = "null", required = true, value = "A unique application id.")
-  @JsonProperty("id")
-  public String getId() {
-    return id;
-  }
-
-  public void setId(String id) {
-    this.id = id;
-  }
+  private String queue = null;
 
   /**
    * A unique application name.
@@ -102,6 +84,24 @@ public class Application extends BaseResource {
   }
 
   /**
+   * A unique application id.
+   **/
+  public Application id(String id) {
+    this.id = id;
+    return this;
+  }
+
+  @ApiModelProperty(example = "null", value = "A unique application id.")
+  @JsonProperty("id")
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  /**
    * Artifact of single-component applications. Mandatory if components
    * attribute is not specified.
    **/
@@ -423,8 +423,8 @@ public class Application extends BaseResource {
     sb.append("    numberOfRunningContainers: ")
         .append(toIndentedString(numberOfRunningContainers)).append("\n");
     sb.append("    lifetime: ").append(toIndentedString(lifetime)).append("\n");
-    sb.append("    placementPolicy: ")
-        .append(toIndentedString(placementPolicy)).append("\n");
+    sb.append("    placementPolicy: ").append(toIndentedString(placementPolicy))
+        .append("\n");
     sb.append("    components: ").append(toIndentedString(components))
         .append("\n");
     sb.append("    configuration: ").append(toIndentedString(configuration))

http://git-wip-us.apache.org/repos/asf/hadoop/blob/42083da0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationState.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/ApplicationState.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationState.java
index ae96e8a..7f90a9e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationState.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationState.java
@@ -17,9 +17,14 @@
 
 package org.apache.hadoop.yarn.services.resource;
 
+import io.swagger.annotations.ApiModel;
+
 /**
  * The current state of an application.
  **/
+
+@ApiModel(description = "The current state of an application.")
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00")
 public enum ApplicationState {
   ACCEPTED, STARTED, READY, STOPPED, FAILED;
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/42083da0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationStatus.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/ApplicationStatus.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationStatus.java
index 0166b48..ed826d8 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationStatus.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/ApplicationStatus.java
@@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Objects;
 
-import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
@@ -33,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
  * GET API.
  **/
 
-@ApiModel(description = "The current status of a submitted application, returned as a response to the GET api")
+@ApiModel(description = "The current status of a submitted application, returned as a response to the GET API.")
 @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00")
 @XmlRootElement
 @JsonInclude(JsonInclude.Include.NON_NULL)
@@ -60,20 +59,19 @@ public class ApplicationStatus extends BaseResource {
     return diagnostics;
   }
 
-  @XmlElement(name = "diagnostics")
   public void setDiagnostics(String diagnostics) {
     this.diagnostics = diagnostics;
   }
 
   /**
-   * Application state
+   * Application state.
    **/
   public ApplicationStatus state(ApplicationState state) {
     this.state = state;
     return this;
   }
 
-  @ApiModelProperty(example = "null", value = "Application state")
+  @ApiModelProperty(example = "null", value = "Application state.")
   @JsonProperty("state")
   public ApplicationState getState() {
     return state;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/42083da0/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 aee4d11..af0ad12 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
@@ -76,14 +76,14 @@ public class Artifact {
   }
 
   /**
-   * Artifact type, like docker, tarball, etc. (optional)
+   * Artifact type, like docker, tarball, etc. (optional).
    **/
   public Artifact type(TypeEnum type) {
     this.type = type;
     return this;
   }
 
-  @ApiModelProperty(example = "null", value = "Artifact type, like docker, tarball, etc. (optional)")
+  @ApiModelProperty(example = "null", value = "Artifact type, like docker, tarball, etc. (optional).")
   @JsonProperty("type")
   public TypeEnum getType() {
     return type;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/42083da0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Component.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/Component.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Component.java
index 3ff6945..1246aa8 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Component.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Component.java
@@ -202,8 +202,11 @@ public class Component {
    * dictates the initial number of components created. Component names
    * typically differ with a trailing id, but assumptions should not be made on
    * that, as the algorithm can change at any time. Configurations section will
-   * be able to use placeholders like ${APP_COMPONENT_NAME} to get its component
-   * name at runtime, and thereby differing in value at runtime. The best part
+   * be able to use placeholders like ${USER}, ${CLUSTER_NAME} and
+   * ${COMPONENT_NAME} to be replaced at runtime with user the app is submitted
+   * as, application name and application component name respectively. Launch
+   * command can use placeholders like ${APP_COMPONENT_NAME} and ${APP_NAME} to
+   * get its component name and app name respectively at runtime. The best part
    * of this feature is that when the component is flexed up, entirely new
    * components (with new trailing ids) are created.
    **/
@@ -212,7 +215,7 @@ public class Component {
     return this;
   }
 
-  @ApiModelProperty(example = "null", value = "Certain applications need to define multiple components using the same artifact and resource profile, differing only in configurations. In such cases, this field helps app owners to avoid creating multiple component definitions with repeated information. The number_of_containers field dictates the initial number of components created. Component names typically differ with a trailing id, but assumptions should not be made on that, as the algorithm can change at any time. Configurations section will be able to use placeholders like ${APP_COMPONENT_NAME} to get its component name at runtime, and thereby differing in value at runtime. The best part of this feature is that when the component is flexed up, entirely new components (with new trailing ids) are created.")
+  @ApiModelProperty(example = "null", value = "Certain applications need to define multiple components using the same artifact and resource profile, differing only in configurations. In such cases, this field helps app owners to avoid creating multiple component definitions with repeated information. The number_of_containers field dictates the initial number of components created. Component names typically differ with a trailing id, but assumptions should not be made on that, as the algorithm can change at any time. Configurations section will be able to use placeholders like ${USER}, ${CLUSTER_NAME} and ${COMPONENT_NAME} to be replaced at runtime with user the app is submitted as, application name and application component name respectively. Launch command can use placeholders like ${APP_COMPONENT_NAME} and ${APP_NAME} to get its component name and app name respectively at runtime. The best part of this feature is that when the component is flexed up, entirely new components (with 
 new trailing ids) are created.")
   @JsonProperty("unique_component_support")
   public Boolean getUniqueComponentSupport() {
     return uniqueComponentSupport;
@@ -316,8 +319,7 @@ public class Component {
         && Objects.equals(this.artifact, component.artifact)
         && Objects.equals(this.launchCommand, component.launchCommand)
         && Objects.equals(this.resource, component.resource)
-        && Objects
-            .equals(this.numberOfContainers, component.numberOfContainers)
+        && Objects.equals(this.numberOfContainers, component.numberOfContainers)
         && Objects.equals(this.uniqueComponentSupport,
             component.uniqueComponentSupport)
         && Objects.equals(this.runPrivilegedContainer,
@@ -354,8 +356,8 @@ public class Component {
         .append(toIndentedString(uniqueComponentSupport)).append("\n");
     sb.append("    runPrivilegedContainer: ")
         .append(toIndentedString(runPrivilegedContainer)).append("\n");
-    sb.append("    placementPolicy: ")
-        .append(toIndentedString(placementPolicy)).append("\n");
+    sb.append("    placementPolicy: ").append(toIndentedString(placementPolicy))
+        .append("\n");
     sb.append("    configuration: ").append(toIndentedString(configuration))
         .append("\n");
     sb.append("    quicklinks: ").append(toIndentedString(quicklinks))

http://git-wip-us.apache.org/repos/asf/hadoop/blob/42083da0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Container.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/Container.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Container.java
index 2faf6f2..4e40102 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Container.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/resource/Container.java
@@ -29,6 +29,10 @@ import javax.xml.bind.annotation.XmlRootElement;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 
+/**
+ * An instance of a running application container.
+ **/
+
 @ApiModel(description = "An instance of a running application container")
 @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00")
 @XmlRootElement
@@ -47,14 +51,14 @@ public class Container extends BaseResource {
 
   /**
    * Unique container id of a running application, e.g.
-   * container_e3751_1458061340047_0008_01_000002
+   * container_e3751_1458061340047_0008_01_000002.
    **/
   public Container id(String id) {
     this.id = id;
     return this;
   }
 
-  @ApiModelProperty(example = "null", value = "Unique container id of a running application, e.g. container_e3751_1458061340047_0008_01_000002")
+  @ApiModelProperty(example = "null", value = "Unique container id of a running application, e.g. container_e3751_1458061340047_0008_01_000002.")
   @JsonProperty("id")
   public String getId() {
     return id;
@@ -65,7 +69,8 @@ public class Container extends BaseResource {
   }
 
   /**
-   * The time when the container was created, e.g. 2016-03-16T01:01:49.000Z. This will most likely be different from cluster launch time.
+   * The time when the container was created, e.g. 2016-03-16T01:01:49.000Z.
+   * This will most likely be different from cluster launch time.
    **/
   public Container launchTime(Date launchTime) {
     this.launchTime = launchTime;
@@ -126,14 +131,14 @@ public class Container extends BaseResource {
 
   /**
    * The bare node or host in which the container is running, e.g.
-   * cn008.example.com
+   * cn008.example.com.
    **/
   public Container bareHost(String bareHost) {
     this.bareHost = bareHost;
     return this;
   }
 
-  @ApiModelProperty(example = "null", value = "The bare node or host in which the container is running, e.g. cn008.example.com")
+  @ApiModelProperty(example = "null", value = "The bare node or host in which the container is running, e.g. cn008.example.com.")
   @JsonProperty("bare_host")
   public String getBareHost() {
     return bareHost;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/42083da0/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 80fdf92..10c951a 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
@@ -57,15 +57,15 @@ public class ReadinessCheck {
   private Artifact artifact = null;
 
   /**
-   * http (YARN will perform a simple REST call at a regular interval and expect
-   * a 204 No content).
+   * E.g. HTTP (YARN will perform a simple REST call at a regular interval and
+   * expect a 204 No content).
    **/
   public ReadinessCheck type(TypeEnum type) {
     this.type = type;
     return this;
   }
 
-  @ApiModelProperty(example = "null", value = "http (YARN will perform a simple REST call at a regular interval and expect a 204 No content).")
+  @ApiModelProperty(example = "null", value = "E.g. HTTP (YARN will perform a simple REST call at a regular interval and expect a 204 No content).")
   @JsonProperty("type")
   public TypeEnum getType() {
     return type;


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