From 955f3c30e48a65ff61a9017e0fe68649b85c985d Mon Sep 17 00:00:00 2001 From: Haibo Chen Date: Tue, 24 Oct 2017 22:17:56 -0700 Subject: [PATCH] YARN-7389. Make TestResourceManager Scheduler agnostic. (Robert Kanter via Haibo Chen) (cherry picked from commit d7f3737f3b3236fbf8c25fdd4656251ed63a2be9) (cherry picked from commit 32a712a7406dd1e742131d1f0aa01279c8335ec1) --- .../yarn/server/resourcemanager/TestResourceManager.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceManager.java index ad8c33502e9..941e4775b2e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestResourceManager.java @@ -39,7 +39,7 @@ import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState; import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode; -import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; +import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.AppAttemptRemovedSchedulerEvent; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.NodeAddedSchedulerEvent; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.NodeUpdateSchedulerEvent; @@ -58,8 +58,6 @@ public class TestResourceManager { @Before public void setUp() throws Exception { Configuration conf = new YarnConfiguration(); - conf.set(YarnConfiguration.RM_SCHEDULER, - CapacityScheduler.class.getCanonicalName()); UserGroupInformation.setConfiguration(conf); resourceManager = new ResourceManager(); resourceManager.init(conf); @@ -133,6 +131,7 @@ public class TestResourceManager { // Send a heartbeat to kick the tires on the Scheduler nodeUpdate(nm1); + ((AbstractYarnScheduler)resourceManager.getResourceScheduler()).update(); // Get allocations from the scheduler application.schedule(); @@ -262,8 +261,6 @@ public class TestResourceManager { } }; Configuration conf = new YarnConfiguration(); - conf.set(YarnConfiguration.RM_SCHEDULER, - CapacityScheduler.class.getCanonicalName()); conf.set(filterInitializerConfKey, filterInitializer); conf.set("hadoop.security.authentication", "kerberos"); conf.set("hadoop.http.authentication.type", "kerberos"); @@ -298,8 +295,6 @@ public class TestResourceManager { for (String filterInitializer : simpleFilterInitializers) { resourceManager = new ResourceManager(); Configuration conf = new YarnConfiguration(); - conf.set(YarnConfiguration.RM_SCHEDULER, - CapacityScheduler.class.getCanonicalName()); conf.set(filterInitializerConfKey, filterInitializer); try { UserGroupInformation.setConfiguration(conf);