From fcbd55d092d5a0d6f93d7f805c78bdbc96e99081 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 28 Nov 2012 12:53:29 +0000 Subject: [PATCH] YARN-222. Fair scheduler should create queue for each user by default. Contributed by Sandy Ryza. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1414655 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../scheduler/fair/FairSchedulerConfiguration.java | 2 +- .../scheduler/fair/TestFairScheduler.java | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 55e9e327f8..71c70fb687 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -109,6 +109,9 @@ Release 2.0.3-alpha - Unreleased YARN-224. Fair scheduler logs too many nodeUpdate INFO messages. (Sandy Ryza via tomwhite) + YARN-222. Fair scheduler should create queue for each user by default. + (Sandy Ryza via tomwhite) + Release 2.0.2-alpha - 2012-09-07 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 8a7f7fc45e..f5706d93bf 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 @@ -18,7 +18,7 @@ public class FairSchedulerConfiguration extends Configuration { /** Whether to use the user name as the queue name (instead of "default") if * the request does not specify a queue. */ protected static final String USER_AS_DEFAULT_QUEUE = CONF_PREFIX + "user-as-default-queue"; - protected static final boolean DEFAULT_USER_AS_DEFAULT_QUEUE = false; + protected static final boolean DEFAULT_USER_AS_DEFAULT_QUEUE = true; protected static final String LOCALITY_THRESHOLD = CONF_PREFIX + "locality.threshold"; protected static final float DEFAULT_LOCALITY_THRESHOLD = -1.0f; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java index 4a26920166..620d0fb913 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java @@ -401,11 +401,11 @@ public void testAppAdditionAndRemoval() throws Exception { createAppAttemptId(1, 1), "default", "user1"); scheduler.handle(appAddedEvent1); - // Scheduler should have one queue (the default) - assertEquals(1, scheduler.getQueueManager().getQueues().size()); + // Scheduler should have two queues (the default and the one created for user1) + assertEquals(2, scheduler.getQueueManager().getQueues().size()); // That queue should have one app - assertEquals(1, scheduler.getQueueManager().getQueue("default").getApplications().size()); + assertEquals(1, scheduler.getQueueManager().getQueue("user1").getApplications().size()); AppRemovedSchedulerEvent appRemovedEvent1 = new AppRemovedSchedulerEvent( createAppAttemptId(1, 1), RMAppAttemptState.FINISHED); @@ -413,8 +413,8 @@ public void testAppAdditionAndRemoval() throws Exception { // Now remove app scheduler.handle(appRemovedEvent1); - // Default queue should have no apps - assertEquals(0, scheduler.getQueueManager().getQueue("default").getApplications().size()); + // Queue should have no apps + assertEquals(0, scheduler.getQueueManager().getQueue("user1").getApplications().size()); } @Test