You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/01/19 15:40:19 UTC

ambari git commit: AMBARI-9195. Configs: Editing HBase Region Server Configuration Parameters (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk fe17e117f -> bcae2e893


AMBARI-9195. Configs: Editing HBase Region Server Configuration Parameters (aonishuk)


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

Branch: refs/heads/trunk
Commit: bcae2e893878790aa5ae7ddbede1e5903d460f27
Parents: fe17e11
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Jan 19 16:40:09 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Jan 19 16:40:09 2015 +0200

----------------------------------------------------------------------
 .../stacks/HDP/2.2/services/stack_advisor.py    | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bcae2e89/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 6cbf3dc..06e66a6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -69,6 +69,10 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 
   def recommendHBASEConfigurations(self, configurations, clusterData, services, hosts):
     servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
+    
+    putHbaseSiteProperty = self.putProperty(configurations, "hbase-site")
+    putHbaseSiteProperty("hbase.regionserver.global.memstore.upperLimit", '0.4')
+    
     if 'ranger-hbase-plugin-properties' in services['configurations']:
       rangerPluginEnabled = services['configurations']['ranger-hbase-plugin-properties']['properties']['ranger-hbase-plugin-enabled']
       if ("RANGER" in servicesList) and (rangerPluginEnabled.lower() == "Yes".lower()):
@@ -422,6 +426,24 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
   def validateHBASEConfigurations(self, properties, recommendedDefaults, configurations, services, hosts):
     hbase_site = properties
     validationItems = [] 
+    
+    prop_name1 = 'hbase.regionserver.global.memstore.upperLimit'
+    prop_name2 = 'hfile.block.cache.size'
+    props_max_sum = 0.8
+
+    if not is_number(hbase_site[prop_name1]):
+      validationItems.append({"config-name": prop_name1,
+                              "item": self.getWarnItem(
+                              "{0} should be float value".format(prop_name1))})
+    elif not is_number(hbase_site[prop_name2]):
+      validationItems.append({"config-name": prop_name2,
+                              "item": self.getWarnItem(
+                              "{0} should be float value".format(prop_name2))})
+    elif float(hbase_site[prop_name1]) + float(hbase_site[prop_name2]) > props_max_sum:
+      validationItems.append({"config-name": prop_name1,
+                              "item": self.getWarnItem(
+                              "{0} and {1} sum should not exceed {2}".format(prop_name1, prop_name2, props_max_sum))})
+      
     #Adding Ranger Plugin logic here 
     ranger_plugin_properties = getSiteProperties(configurations, "ranger-hbase-plugin-properties")
     ranger_plugin_enabled = ranger_plugin_properties['ranger-hbase-plugin-enabled']
@@ -474,3 +496,12 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     result = super(HDP22StackAdvisor, self).getComponentLayoutSchemes()
     result['METRIC_COLLECTOR'] = {"else": 2}
     return result
+  
+def is_number(s):
+  try:
+    float(s)
+    return True
+  except ValueError:
+    pass
+
+  return False
\ No newline at end of file