diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 9c484c7e8a7..3052ed326d7 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/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 diff --git a/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 b/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 index 473c369b092..a96952daaa8 100644 --- a/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 +++ b/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. */ diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/TestRMApplicationHistoryWriter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/TestRMApplicationHistoryWriter.java index 1c90ad213dd..78077d4fa34 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/TestRMApplicationHistoryWriter.java +++ b/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