hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject [61/75] [abbrv] hadoop git commit: YARN-4256. YARN fair scheduler vcores with decimal values. Contributed by Jun Gong
Date Fri, 23 Oct 2015 19:01:28 GMT
YARN-4256. YARN fair scheduler vcores with decimal values. Contributed by Jun Gong


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

Branch: refs/heads/HADOOP-11890
Commit: 960201b79b9f2ca40f8eadb21a2f9fe37dde2b5d
Parents: 47641fc
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:28:03 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/960201b7/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 79df1ce..024255c 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -975,6 +975,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/960201b7/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/960201b7/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