hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From templ...@apache.org
Subject hadoop git commit: YARN-6935. [YARN-3926] ResourceProfilesManagerImpl.parseResource() has no need of the key parameter (Contributed by Manikandan R via Daniel Templeton)
Date Fri, 11 Aug 2017 23:35:57 GMT
Repository: hadoop
Updated Branches:
  refs/heads/YARN-3926 1b586d700 -> 5452a0748


YARN-6935. [YARN-3926] ResourceProfilesManagerImpl.parseResource() has no need of the key
parameter
(Contributed by Manikandan R via Daniel Templeton)


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

Branch: refs/heads/YARN-3926
Commit: 5452a07487388a9f9ad3759c61bdbc606d834eb9
Parents: 1b586d7
Author: Daniel Templeton <templedf@apache.org>
Authored: Fri Aug 11 16:32:13 2017 -0700
Committer: Daniel Templeton <templedf@apache.org>
Committed: Fri Aug 11 16:32:13 2017 -0700

----------------------------------------------------------------------
 .../resource/ResourceProfilesManagerImpl.java   | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5452a074/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.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/resource/ResourceProfilesManagerImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.java
index ab33336..b5ab384 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.java
@@ -87,22 +87,22 @@ public class ResourceProfilesManagerImpl implements ResourceProfilesManager
{
     Iterator iterator = data.entrySet().iterator();
     while (iterator.hasNext()) {
       Map.Entry entry = (Map.Entry) iterator.next();
-      String key = entry.getKey().toString();
-      if (key.isEmpty()) {
+      String profileName = entry.getKey().toString();
+      if (profileName.isEmpty()) {
         throw new IOException(
             "Name of resource profile cannot be an empty string");
       }
       if (entry.getValue() instanceof Map) {
-        Map value = (Map) entry.getValue();
+        Map profileInfo = (Map) entry.getValue();
         // ensure memory and vcores are specified
-        if (!value.containsKey(MEMORY) || !value.containsKey(VCORES)) {
+        if (!profileInfo.containsKey(MEMORY) || !profileInfo.containsKey(VCORES)) {
           throw new IOException(
-              "Illegal resource profile definition; profile '" + key
+              "Illegal resource profile definition; profile '" + profileName
                   + "' must contain '" + MEMORY + "' and '" + VCORES + "'");
         }
-        Resource resource = parseResource(key, value);
-        profiles.put(key, resource);
-        LOG.info("Added profile '" + key + "' with resources " + resource);
+        Resource resource = parseResource(profileInfo);
+        profiles.put(profileName, resource);
+        LOG.info("Added profile '" + profileName + "' with resources " + resource);
       }
     }
     // check to make sure mandatory profiles are present
@@ -116,9 +116,9 @@ public class ResourceProfilesManagerImpl implements ResourceProfilesManager
{
     LOG.info("Loaded profiles " + profiles.keySet());
   }
 
-  private Resource parseResource(String key, Map value) throws IOException {
+  private Resource parseResource(Map profileInfo) throws IOException {
     Resource resource = Resource.newInstance(0, 0);
-    Iterator iterator = value.entrySet().iterator();
+    Iterator iterator = profileInfo.entrySet().iterator();
     Map<String, ResourceInformation> resourceTypes = ResourceUtils
         .getResourceTypes();
     while (iterator.hasNext()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message