You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by ma...@apache.org on 2011/07/13 05:01:48 UTC

svn commit: r1145844 - in /hadoop/common/branches/MR-279/mapreduce: CHANGES.txt yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java

Author: mahadev
Date: Wed Jul 13 03:01:48 2011
New Revision: 1145844

URL: http://svn.apache.org/viewvc?rev=1145844&view=rev
Log:
MAPREDUCE-2630. refreshQueues leads to NPEs when used w/FifoScheduler. (Josh Willis via mahadev)

Modified:
    hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java

Modified: hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/CHANGES.txt?rev=1145844&r1=1145843&r2=1145844&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/CHANGES.txt (original)
+++ hadoop/common/branches/MR-279/mapreduce/CHANGES.txt Wed Jul 13 03:01:48 2011
@@ -4,7 +4,10 @@ Trunk (unreleased changes)
 
 
     MAPREDUCE-279
-
+   
+    MAPREDUCE-2630. refreshQueues leads to NPEs when used w/FifoScheduler. 
+    (Josh Willis via mahadev)
+ 
     MAPREDUCE-2678. minimum-user-limit-percent no longer honored. (naisbitt 
     via mahadev)
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java?rev=1145844&r1=1145843&r2=1145844&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java (original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java Wed Jul 13 03:01:48 2011
@@ -100,6 +100,7 @@ public class FifoScheduler implements Re
   public static final String MAXIMUM_ALLOCATION = 
     FIFO_PREFIX + "maximum-allocation-mb";
 
+  private boolean initialized;
   private Resource minimumAllocation;
   private Resource maximumAllocation;
 
@@ -187,14 +188,19 @@ public class FifoScheduler implements Re
       ClusterTracker clusterTracker) 
   throws IOException 
   {
-    this.conf = conf;
-    this.containerTokenSecretManager = containerTokenSecretManager;
-    this.clusterTracker = clusterTracker;
-    if (clusterTracker != null) this.clusterTracker.addListener(this);
-    this.minimumAllocation = 
-      Resources.createResource(conf.getInt(MINIMUM_ALLOCATION, MINIMUM_MEMORY));
-    this.maximumAllocation = 
-      Resources.createResource(conf.getInt(MAXIMUM_ALLOCATION, MAXIMUM_MEMORY));
+    if (!this.initialized) {
+      this.conf = conf;
+      this.containerTokenSecretManager = containerTokenSecretManager;
+      this.clusterTracker = clusterTracker;
+      if (clusterTracker != null) this.clusterTracker.addListener(this);
+      this.minimumAllocation = 
+        Resources.createResource(conf.getInt(MINIMUM_ALLOCATION, MINIMUM_MEMORY));
+      this.maximumAllocation = 
+        Resources.createResource(conf.getInt(MAXIMUM_ALLOCATION, MAXIMUM_MEMORY));
+      this.initialized = true;
+    } else {
+      this.conf = conf;
+    }
   }
 
   @Override