hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject hadoop git commit: YARN-4256. YARN fair scheduler vcores with decimal values. Contributed by Jun Gong
Date Thu, 22 Oct 2015 19:36:09 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 10398daad -> 9fe7ccc61


YARN-4256. YARN fair scheduler vcores with decimal values. Contributed by Jun Gong

(cherry picked from commit 960201b79b9f2ca40f8eadb21a2f9fe37dde2b5d)


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

Branch: refs/heads/branch-2
Commit: 9fe7ccc61cc6d7ebe3134ba37ced66477a2bf3c7
Parents: 10398da
Author: Zhihai Xu <zxu@apache.org>
Authored: Thu Oct 22 12:27:48 2015 -0700
Committer: Zhihai Xu <zxu@apache.org>
Committed: Thu Oct 22 12:31:28 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                                  | 2 ++
 .../scheduler/fair/FairSchedulerConfiguration.java               | 2 +-
 .../scheduler/fair/TestFairSchedulerConfiguration.java           | 4 ++++
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9fe7ccc6/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index eeb21cb..8f090f5 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -923,6 +923,8 @@ Release 2.8.0 - UNRELEASED
     YARN-4270. Limit application resource reservation on nodes for non-node/rack
     specific requests (asuresh)
 
+    YARN-4256. YARN fair scheduler vcores with decimal values. (Jun Gong via zxu)
+
 Release 2.7.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9fe7ccc6/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
----------------------------------------------------------------------
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 74af70f..5dfee95 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
@@ -283,7 +283,7 @@ public class FairSchedulerConfiguration extends Configuration {
   
   private static int findResource(String val, String units)
     throws AllocationConfigurationException {
-    Pattern pattern = Pattern.compile("(\\d+)\\s*" + units);
+    Pattern pattern = Pattern.compile("(\\d+)(\\.\\d*)?\\s*" + units);
     Matcher matcher = pattern.matcher(val);
     if (!matcher.find()) {
       throw new AllocationConfigurationException("Missing resource: " + units);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9fe7ccc6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerConfiguration.java
----------------------------------------------------------------------
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/TestFairSchedulerConfiguration.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/TestFairSchedulerConfiguration.java
index 82b50a6..8e7b666 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/TestFairSchedulerConfiguration.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/TestFairSchedulerConfiguration.java
@@ -45,6 +45,10 @@ public class TestFairSchedulerConfiguration {
         parseResourceConfigValue("1024 Mb, 2 vCores"));
     assertEquals(BuilderUtils.newResource(1024, 2),
         parseResourceConfigValue("  1024 mb, 2 vcores  "));
+    assertEquals(BuilderUtils.newResource(1024, 2),
+        parseResourceConfigValue("  1024.3 mb, 2.35 vcores  "));
+    assertEquals(BuilderUtils.newResource(1024, 2),
+        parseResourceConfigValue("  1024. mb, 2. vcores  "));
   }
   
   @Test(expected = AllocationConfigurationException.class)


Mime
View raw message