ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-13269 Ambari map/reduce/AM java opts do not change if memory settings are modified (dsen)
Date Tue, 29 Sep 2015 18:03:09 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1.2 743ab5ce0 -> 80d9e3b19


AMBARI-13269 Ambari map/reduce/AM java opts do not change if memory settings are modified
(dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/80d9e3b1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/80d9e3b1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/80d9e3b1

Branch: refs/heads/branch-2.1.2
Commit: 80d9e3b1968625d97fae580cc753bf180b35c3fe
Parents: 743ab5c
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Sep 29 21:01:44 2015 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Sep 29 21:02:55 2015 +0300

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 11 +++++++--
 .../stacks/2.2/common/test_stack_advisor.py     | 24 +++++++++++++-------
 2 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/80d9e3b1/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 71bf6ca..b6a74a4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -104,12 +104,19 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
     if"properties" not in config[configType]:
       config[configType]["properties"] = {}
     def appendProperty(key, value):
-      if {'type': configType, 'name': key} in changedConfigs:
+      # If property exists in changedConfigs, do not override, use user defined property
+      if self.__isPropertyInChangedConfigs(configType, key, changedConfigs):
         config[configType]["properties"][key] = userConfigs[configType]['properties'][key]
       else:
         config[configType]["properties"][key] = str(value)
     return appendProperty
 
+  def __isPropertyInChangedConfigs(self, configType, propertyName, changedConfigs):
+    for changedConfig in changedConfigs:
+      if changedConfig['type']==configType and changedConfig['name']==propertyName:
+        return True
+    return False
+
   def putPropertyAttribute(self, config, configType):
     if configType not in config:
       config[configType] = {}
@@ -1218,4 +1225,4 @@ def getMemorySizeRequired(components, configurations):
   return totalMemoryRequired
 
 def round_to_n(mem_size, n=128):
-  return int(round(mem_size / float(n))) * int(n)
\ No newline at end of file
+  return int(round(mem_size / float(n))) * int(n)

http://git-wip-us.apache.org/repos/asf/ambari/blob/80d9e3b1/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index 054bf96..97cf4ca 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -837,15 +837,18 @@ class TestHDP22StackAdvisor(TestCase):
       "changed-configurations": [
         {
           "type": "yarn-site",
-          "name": "yarn.nodemanager.resource.memory-mb"
+          "name": "yarn.nodemanager.resource.memory-mb",
+          "old_value": "512"
         },
         {
           "type": "yarn-site",
-          "name": "yarn.scheduler.minimum-allocation-mb"
+          "name": "yarn.scheduler.minimum-allocation-mb",
+          "old_value": "512"
         },
         {
           "type": "yarn-site",
-          "name": "yarn.scheduler.maximum-allocation-mb"
+          "name": "yarn.scheduler.maximum-allocation-mb",
+          "old_value": "512"
         },
         {
           "type": "yarn-site",
@@ -926,7 +929,8 @@ class TestHDP22StackAdvisor(TestCase):
     configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"]
= '0.5'
     services["changed-configurations"].append({
           "type": "yarn-site",
-          "name": "yarn.nodemanager.resource.percentage-physical-cpu-limit"
+          "name": "yarn.nodemanager.resource.percentage-physical-cpu-limit",
+          "old_value": "6"
         })
     expected["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"] = '5'
     expected["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-vcores"] = '1'
@@ -1600,7 +1604,8 @@ class TestHDP22StackAdvisor(TestCase):
       "changed-configurations": [
         {
           "type": "yarn-site",
-          "name": "yarn.scheduler.minimum-allocation-mb"
+          "name": "yarn.scheduler.minimum-allocation-mb",
+          "old_value": "512"
         },
         ]
 
@@ -1836,7 +1841,8 @@ class TestHDP22StackAdvisor(TestCase):
       "changed-configurations": [
         {
           "type": "yarn-site",
-          "name": "yarn.scheduler.minimum-allocation-mb"
+          "name": "yarn.scheduler.minimum-allocation-mb",
+          "old_value": "512"
         },
       ]
 
@@ -2114,7 +2120,8 @@ class TestHDP22StackAdvisor(TestCase):
     services['changed-configurations'] = [
       {
         "type": "ams-hbase-env",
-        "name": "hbase_master_heapsize"
+        "name": "hbase_master_heapsize",
+        "old_value": "1024"
       }
     ]
 
@@ -2155,7 +2162,8 @@ class TestHDP22StackAdvisor(TestCase):
     services['changed-configurations'] = [
       {
         "type": "ams-hbase-env",
-        "name": "hbase_regionserver_heapsize"
+        "name": "hbase_regionserver_heapsize",
+        "old_value": "512"
       }
     ]
     services["configurations"]['ams-hbase-site']['properties']['hbase.rootdir'] = 'hdfs://host1/amshbase'


Mime
View raw message