Selaa lähdekoodia

YARN-2452. TestRMApplicationHistoryWriter fails with FairScheduler. (Zhihai Xu via kasha)

Karthik Kambatla 10 vuotta sitten
vanhempi
commit
c50fc92502

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -406,6 +406,9 @@ Release 2.6.0 - UNRELEASED
     YARN-2460. Remove obsolete entries from yarn-default.xml (Ray Chiang via
     aw)
 
+    YARN-2452. TestRMApplicationHistoryWriter fails with FairScheduler. 
+    (Zhihai Xu via kasha)
+
 Release 2.5.1 - 2014-09-05
 
   INCOMPATIBLE CHANGES

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairSchedulerConfiguration.java

@@ -112,7 +112,7 @@ public class FairSchedulerConfiguration extends Configuration {
   protected static final int DEFAULT_WAIT_TIME_BEFORE_KILL = 15000;
 
   /** Whether to assign multiple containers in one check-in. */
-  protected static final String  ASSIGN_MULTIPLE = CONF_PREFIX + "assignmultiple";
+  public static final String  ASSIGN_MULTIPLE = CONF_PREFIX + "assignmultiple";
   protected static final boolean DEFAULT_ASSIGN_MULTIPLE = false;
 
   /** Whether to give more weight to apps requiring many resources. */

+ 23 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/TestRMApplicationHistoryWriter.java

@@ -60,6 +60,9 @@ import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState;
 import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerConfiguration;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -369,10 +372,29 @@ public class TestRMApplicationHistoryWriter {
   }
 
   @Test
-  public void testRMWritingMassiveHistory() throws Exception {
+  public void testRMWritingMassiveHistoryForFairSche() throws Exception {
+    //test WritingMassiveHistory for Fair Scheduler.
+    testRMWritingMassiveHistory(true);
+  }
+
+  @Test
+  public void testRMWritingMassiveHistoryForCapacitySche() throws Exception {
+    //test WritingMassiveHistory for Capacity Scheduler.
+    testRMWritingMassiveHistory(false);
+  }
+
+  private void testRMWritingMassiveHistory(boolean isFS) throws Exception {
     // 1. Show RM can run with writing history data
     // 2. Test additional workload of processing history events
     YarnConfiguration conf = new YarnConfiguration();
+    if (isFS) {
+      conf.setBoolean(FairSchedulerConfiguration.ASSIGN_MULTIPLE, true);
+      conf.set("yarn.resourcemanager.scheduler.class",
+          FairScheduler.class.getName());
+    } else {
+      conf.set("yarn.resourcemanager.scheduler.class",
+          CapacityScheduler.class.getName());
+    }
     // don't process history events
     MockRM rm = new MockRM(conf) {
       @Override