You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2015/11/20 02:39:23 UTC

ambari git commit: AMBARI-13978. Allow AMS to accept property values with or without m (Aravindan Vijayan via smohanty)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 29ad1e5e0 -> 25cd36467


AMBARI-13978. Allow AMS to accept property values with or without m (Aravindan Vijayan via smohanty)


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

Branch: refs/heads/branch-2.1
Commit: 25cd364671c63532198033e0e6c0b51df22e113b
Parents: 29ad1e5
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu Nov 19 17:38:56 2015 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Nov 19 17:39:01 2015 -0800

----------------------------------------------------------------------
 .../AMBARI_METRICS/0.1.0/package/scripts/functions.py       | 7 +++++++
 .../AMBARI_METRICS/0.1.0/package/scripts/params.py          | 9 +++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/25cd3646/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
index 4ec3d16..01315e5 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
@@ -36,3 +36,10 @@ def calc_xmn_from_xms(heapsize, xmn_percent, xmn_max):
   
   result_xmn_val = xmn_max if xmn_val > xmn_max else xmn_val
   return result_xmn_val
+
+def trim_heap_property(property, m_suffix = "m"):
+
+  if property and property.endswith(m_suffix):
+    property = property[:-1]
+
+  return property

http://git-wip-us.apache.org/repos/asf/ambari/blob/25cd3646/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index eb2993f..cc69148 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -19,6 +19,8 @@ limitations under the License.
 """
 
 from functions import calc_xmn_from_xms
+from functions import trim_heap_property
+
 from resource_management import *
 import status_params
 from ambari_commons import OSCheck
@@ -107,6 +109,13 @@ pass
 hbase_master_xmn_size = config['configurations']['ams-hbase-env']['hbase_master_xmn_size']
 hbase_master_maxperm_size = config['configurations']['ams-hbase-env']['hbase_master_maxperm_size']
 
+# Check if hbase java options already have appended "m". If Yes, remove the trailing m.
+master_heapsize = int(trim_heap_property(str(master_heapsize), "m"))
+regionserver_heapsize = int(trim_heap_property(str(regionserver_heapsize), "m"))
+hbase_master_maxperm_size = int(trim_heap_property(str(hbase_master_maxperm_size), "m"))
+hbase_master_xmn_size = int(trim_heap_property(str(hbase_master_xmn_size), "m"))
+regionserver_xmn_size = int(trim_heap_property(str(regionserver_xmn_size), "m"))
+
 # Choose heap size for embedded mode as sum of master + regionserver
 if not is_hbase_distributed:
   hbase_heapsize = master_heapsize + regionserver_heapsize