hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From su...@apache.org
Subject hadoop git commit: YARN-7311. Fix TestRMWebServicesReservation parametrization for fair scheduler. (Yufei Gu via Subru).
Date Tue, 17 Oct 2017 19:43:25 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.0 5334deb08 -> 81a86860b


YARN-7311. Fix TestRMWebServicesReservation parametrization for fair scheduler. (Yufei Gu
via Subru).

(cherry picked from commit 75323394fbc4211596a2c8fbb5e584f3183f742f)


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

Branch: refs/heads/branch-3.0
Commit: 81a86860bf4a4d03e002b0bc7fc5aa4a4c103f57
Parents: 5334deb
Author: Subru Krishnan <subu@apache.org>
Authored: Tue Oct 17 12:38:06 2017 -0700
Committer: Subru Krishnan <subu@apache.org>
Committed: Tue Oct 17 12:39:40 2017 -0700

----------------------------------------------------------------------
 .../reservation/FairReservationSystem.java      | 13 +++++++++
 .../webapp/TestRMWebServicesReservation.java    | 28 +++++++++++---------
 2 files changed, 28 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/81a86860/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/FairReservationSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/FairReservationSystem.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/FairReservationSystem.java
index 9bf92c2..611fca8 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/FairReservationSystem.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/FairReservationSystem.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
 import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler;
 import org.apache.hadoop.yarn.util.resource.ResourceCalculator;
 
@@ -87,4 +88,16 @@ public class FairReservationSystem extends AbstractReservationSystem {
         .getSteadyFairShare();
   }
 
+  @Override
+  public Plan getPlan(String planName) {
+    // make sure plan name is a full queue name in fair scheduler. For example,
+    // "root.default" is the full queue name for "default".
+    FSQueue queue = fairScheduler.getQueueManager().getQueue(planName);
+
+    if (queue != null) {
+      return super.getPlan(queue.getQueueName());
+    } else {
+      return null;
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/81a86860/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
index 657bec4..02aa65f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
@@ -145,21 +145,9 @@ public class TestRMWebServicesReservation extends JerseyTestBase {
       bind(GenericExceptionHandler.class);
       conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
           YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
-      Configuration conf = new Configuration();
       conf.setBoolean(YarnConfiguration.RM_RESERVATION_SYSTEM_ENABLE, true);
-      conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
-          YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
-      conf.setClass(YarnConfiguration.RM_SCHEDULER, CapacityScheduler.class,
-          ResourceScheduler.class);
-      CapacitySchedulerConfiguration csconf =
-          new CapacitySchedulerConfiguration(conf);
-      String[] queues = { "default", "dedicated" };
-      csconf.setQueues("root", queues);
-      csconf.setCapacity("root.default", 50.0f);
-      csconf.setCapacity("root.dedicated", 50.0f);
-      csconf.setReservable("root.dedicated", true);
 
-      rm = new MockRM(csconf);
+      rm = new MockRM(conf);
       bind(ResourceManager.class).toInstance(rm);
       if (setAuthFilter) {
         filter("/*").through(TestRMCustomAuthFilter.class);
@@ -173,6 +161,16 @@ public class TestRMWebServicesReservation extends JerseyTestBase {
     public void configureScheduler() {
       conf.set(YarnConfiguration.RM_SCHEDULER,
           CapacityScheduler.class.getName());
+      conf.setClass(YarnConfiguration.RM_SCHEDULER, CapacityScheduler.class,
+          ResourceScheduler.class);
+      CapacitySchedulerConfiguration csconf =
+          new CapacitySchedulerConfiguration(conf);
+      String[] queues = { "default", "dedicated" };
+      csconf.setQueues("root", queues);
+      csconf.setCapacity("root.default", 50.0f);
+      csconf.setCapacity("root.dedicated", 50.0f);
+      csconf.setReservable("root.dedicated", true);
+      conf = csconf;
     }
   }
 
@@ -189,9 +187,13 @@ public class TestRMWebServicesReservation extends JerseyTestBase {
         out.println("    <aclAdministerApps>someuser </aclAdministerApps>");
         out.println("  </queue>");
         out.println("  <queue name=\"dedicated\">");
+        out.println("    <reservation>");
+        out.println("    </reservation>");
         out.println("    <aclAdministerApps>someuser </aclAdministerApps>");
         out.println("  </queue>");
         out.println("</queue>");
+        out.println("<defaultQueueSchedulingPolicy>drf" +
+            "</defaultQueueSchedulingPolicy>");
         out.println("</allocations>");
         out.close();
       } catch (IOException e) {


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