hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xg...@apache.org
Subject git commit: YARN-2726. CapacityScheduler should explicitly log when an accessible label has no capacity. Contributed by Wangda Tan
Date Mon, 27 Oct 2014 17:29:13 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 5f3d967aa -> 3a7783853


YARN-2726. CapacityScheduler should explicitly log when an accessible label has no capacity.
Contributed by Wangda Tan


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3a778385
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3a778385
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3a778385

Branch: refs/heads/branch-2
Commit: 3a77838535aebcb0623e280ceb20bbd1d04da796
Parents: 5f3d967
Author: Xuan <xgong@apache.org>
Authored: Mon Oct 27 10:28:45 2014 -0700
Committer: Xuan <xgong@apache.org>
Committed: Mon Oct 27 10:28:45 2014 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                      |  3 +++
 .../capacity/CapacitySchedulerConfiguration.java     | 15 +++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3a778385/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 74d1dff..323bacf 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -733,6 +733,9 @@ Release 2.6.0 - UNRELEASED
     YARN-2734. Skipped sub-folders in the local log dir when aggregating logs.
     (Xuan Gong via zjshen)
 
+    YARN-2726. CapacityScheduler should explicitly log when an accessible
+    label has no capacity. (Wangda Tan via xgong)
+
 Release 2.5.1 - 2014-09-05
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3a778385/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerConfiguration.java
----------------------------------------------------------------------
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/capacity/CapacitySchedulerConfiguration.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerConfiguration.java
index 5beed37..b36172c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerConfiguration.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerConfiguration.java
@@ -466,12 +466,19 @@ public class CapacitySchedulerConfiguration extends Configuration {
         nodeLabelCapacities.put(label, 1.0f);
         continue;
       }
-      float capacity =
-          getFloat(getNodeLabelPrefix(queue, label) + CAPACITY, UNDEFINED);
+      String capacityPropertyName = getNodeLabelPrefix(queue, label) + CAPACITY;
+      float capacity = getFloat(capacityPropertyName, UNDEFINED);
+      if (capacity == UNDEFINED) {
+        throw new IllegalArgumentException("Configuration issue: "
+            + " node-label=" + label + " is accessible from queue=" + queue
+            + " but has no capacity set, you should set " 
+            + capacityPropertyName + " in range of [0, 100].");
+      }
       if (capacity < MINIMUM_CAPACITY_VALUE
           || capacity > MAXIMUM_CAPACITY_VALUE) {
-        throw new IllegalArgumentException("Illegal " + "capacity of "
-            + capacity + " for label=" + label + " in queue=" + queue);
+        throw new IllegalArgumentException("Illegal capacity of " + capacity
+            + " for node-label=" + label + " in queue=" + queue
+            + ", valid capacity should in range of [0, 100].");
       }
       if (LOG.isDebugEnabled()) {
         LOG.debug("CSConf - getCapacityOfLabel: prefix="


Mime
View raw message