Repository: hadoop
Updated Branches:
  refs/heads/branch-3.1 53abef4e3 -> c1b4c6adf


YARN-7941. Transitive dependencies for component are not resolved. Contributed 
by Billie Rinaldi.

(cherry picked from commit c0487110990958fa985d273eb178bdf76002cf3a)


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

Branch: refs/heads/branch-3.1
Commit: c1b4c6adf4e6fc733ed633f79f717de2950d607e
Parents: 53abef4
Author: Rohith Sharma K S <rohithsharm...@apache.org>
Authored: Wed Apr 11 09:18:50 2018 +0530
Committer: Rohith Sharma K S <rohithsharm...@apache.org>
Committed: Wed Apr 11 09:19:48 2018 +0530

----------------------------------------------------------------------
 .../hadoop/yarn/service/component/Component.java    |  1 +
 .../hadoop/yarn/service/TestYarnNativeServices.java | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c1b4c6ad/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java
index 3090692..9e10ae6 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java
@@ -164,6 +164,7 @@ public class Component implements 
EventHandler<ComponentEvent> {
     maxContainerFailurePerComp = componentSpec.getConfiguration()
         .getPropertyInt(CONTAINER_FAILURE_THRESHOLD, 10);
     createNumCompInstances(component.getNumberOfContainers());
+    setDesiredContainers(component.getNumberOfContainers().intValue());
   }
 
   private void createNumCompInstances(long count) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c1b4c6ad/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
index 091e624..51a190e 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java
@@ -137,7 +137,9 @@ public class TestYarnNativeServices extends 
ServiceTestUtils {
 
   // Create compa with 2 containers
   // Create compb with 2 containers which depends on compa
-  // Check containers for compa started before containers for compb
+  // Create compc with 2 containers which depends on compb
+  // Check containers for compa started before containers for compb before
+  // containers for compc
   @Test (timeout = 200000)
   public void testComponentStartOrder() throws Exception {
     setupInternal(NUM_NMS);
@@ -146,17 +148,23 @@ public class TestYarnNativeServices extends 
ServiceTestUtils {
     exampleApp.setName("teststartorder");
     exampleApp.setVersion("v1");
     exampleApp.addComponent(createComponent("compa", 2, "sleep 1000"));
-    Component compb = createComponent("compb", 2, "sleep 1000");
 
-    // Let compb depedends on compa;
+    // Let compb depend on compa
+    Component compb = createComponent("compb", 2, "sleep 1000");
     compb.setDependencies(Collections.singletonList("compa"));
     exampleApp.addComponent(compb);
 
+    // Let compc depend on compb
+    Component compc = createComponent("compc", 2, "sleep 1000");
+    compc.setDependencies(Collections.singletonList("compb"));
+    exampleApp.addComponent(compc);
+
     client.actionCreate(exampleApp);
     waitForServiceToBeStable(client, exampleApp);
 
     // check that containers for compa are launched before containers for compb
-    checkContainerLaunchDependencies(client, exampleApp, "compa", "compb");
+    checkContainerLaunchDependencies(client, exampleApp, "compa", "compb",
+        "compc");
 
     client.actionStop(exampleApp.getName(), true);
     client.actionDestroy(exampleApp.getName());


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

Reply via email to