hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From naganarasimha...@apache.org
Subject hadoop git commit: YARN-4925. ContainerRequest in AMRMClient, application should be able to specify nodes/racks together with nodeLabelExpression. Contributed by Bibin A Chundatt
Date Wed, 18 May 2016 17:39:13 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 3c9392a31 -> a166286b9


YARN-4925. ContainerRequest in AMRMClient, application should be able to specify nodes/racks
together with nodeLabelExpression. Contributed by Bibin A Chundatt

(cherry picked from commit f04c81c9ce93512bc714531a7731debbe6b794ce)


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

Branch: refs/heads/branch-2
Commit: a166286b9e69873afe3927898b5937a00ec217f6
Parents: 3c9392a
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Thu May 19 01:30:12 2016 +0800
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Thu May 19 01:35:47 2016 +0800

----------------------------------------------------------------------
 .../hadoop/yarn/client/api/impl/AMRMClientImpl.java    | 10 ----------
 .../hadoop/yarn/client/api/impl/TestAMRMClient.java    | 13 ++++++++++++-
 2 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a166286b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
index 37a1fb6..46ddc4d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java
@@ -712,16 +712,6 @@ public class AMRMClientImpl<T extends ContainerRequest> extends
AMRMClient<T> {
           "Cannot specify more than two node labels"
               + " in a single node label expression");
     }
-    
-    // Don't allow specify node label against ANY request
-    if ((containerRequest.getRacks() != null && 
-        (!containerRequest.getRacks().isEmpty()))
-        || 
-        (containerRequest.getNodes() != null && 
-        (!containerRequest.getNodes().isEmpty()))) {
-      throw new InvalidContainerRequestException(
-          "Cannot specify node label with rack and node");
-    }
   }
 
   private void validateContainerResourceChangeRequest(

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a166286b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
index 3b3c0ed..75b49d0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
@@ -35,11 +35,11 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.CommonConfigurationKeys;
 import org.apache.hadoop.io.DataOutputBuffer;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.security.Credentials;
@@ -713,6 +713,17 @@ public class TestAMRMClient {
         Assert.assertNull(req.getNodeLabelExpression());
       }
     }
+    // set container with nodes and racks with labels
+    client.addContainerRequest(new ContainerRequest(
+        Resource.newInstance(1024, 1), new String[] { "rack1" },
+        new String[] { "node1", "node2" }, Priority.UNDEFINED, true, "y"));
+    for (ResourceRequest req : client.ask) {
+      if (ResourceRequest.ANY.equals(req.getResourceName())) {
+        Assert.assertEquals("y", req.getNodeLabelExpression());
+      } else {
+        Assert.assertNull(req.getNodeLabelExpression());
+      }
+    }
   }
   
   private void verifyAddRequestFailed(AMRMClient<ContainerRequest> client,


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