You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mi...@apache.org on 2016/06/02 03:34:25 UTC

ambari git commit: AMBARI-16992: Recommend hawq_rm_nvcore_limit_perseg in HAWQ service advisor (mithmatt)

Repository: ambari
Updated Branches:
  refs/heads/trunk 0aeaa9565 -> bd85c2815


AMBARI-16992: Recommend hawq_rm_nvcore_limit_perseg in HAWQ service advisor (mithmatt)


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

Branch: refs/heads/trunk
Commit: bd85c28158b8c1bd7dbea13ac25519a2551d917d
Parents: 0aeaa95
Author: Matt <mm...@pivotal.io>
Authored: Wed Jun 1 20:34:08 2016 -0700
Committer: Matt <mm...@pivotal.io>
Committed: Wed Jun 1 20:34:08 2016 -0700

----------------------------------------------------------------------
 .../HAWQ/2.0.0/configuration/hawq-site.xml           |  6 ++++++
 .../common-services/HAWQ/2.0.0/service_advisor.py    |  2 +-
 .../python/stacks/2.3/HAWQ/test_service_advisor.py   | 15 +++++++++------
 3 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bd85c281/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
index a326562..f72fce8 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
@@ -199,6 +199,12 @@
       The maximum number of virtual cores that can be used for query execution in a HAWQ segment when Resource Manager ('hawq_global_rm_type') is set to Standalone ('none').
       The default is 16.
     </description>
+    <depends-on>
+      <property>
+        <type>hawq-site</type>
+        <name>hawq_global_rm_type</name>
+      </property>
+    </depends-on>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd85c281/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/service_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/service_advisor.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/service_advisor.py
index 32e23f9..28eb82f 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/service_advisor.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/service_advisor.py
@@ -168,7 +168,7 @@ class HAWQ200ServiceAdvisor(service_advisor.ServiceAdvisor):
           buckets = factor * numSegments
         putHawqSiteProperty('default_hash_table_bucket_number', buckets)
 
-      if "hawq_rm_nvcore_limit_perseg" in hawq_site:
+      if "hawq_global_rm_type" in hawq_site and hawq_site["hawq_global_rm_type"] == "none" and "hawq_rm_nvcore_limit_perseg" in hawq_site:
         putHawqSiteProperty('hawq_rm_nvcore_limit_perseg', minHawqHostsCoreCount)
 
       # update YARN RM urls with the values from yarn-site if YARN is installed

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd85c281/ambari-server/src/test/python/stacks/2.3/HAWQ/test_service_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_service_advisor.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_service_advisor.py
index 6531454..5750938 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_service_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_service_advisor.py
@@ -142,7 +142,8 @@ class TestHAWQ200ServiceAdvisor(TestCase):
       "hawq-site": {
         "properties": {
           "hawq_rm_memory_limit_perseg": "67108864KB",
-          "hawq_rm_nvcore_limit_perseg": "16"
+          "hawq_rm_nvcore_limit_perseg": "16",
+          "hawq_global_rm_type": "yarn"
         }
       }
     }
@@ -217,16 +218,18 @@ class TestHAWQ200ServiceAdvisor(TestCase):
 
     # Case 1:
     # HAWQ Hosts Core Count: c6401.ambari.apache.org - 2, c6402.ambari.apache.org - 4, c6404.ambari.apache.org - 2
+    # hawq_global_rm_type: yarn
     # Non HAWQ Hosts Core Count: c6401.ambari.apache.org - 1
-    # Recommend hawq_rm_nvcore_limit_perseg as 2
+    # Do not recommend hawq_rm_nvcore_limit_perseg when rm type is yarn
     self.serviceAdvisor.getServiceConfigurationRecommendations(self.stackAdvisor, configurations, None, services, hosts)
-    self.assertEquals(configurations["hawq-site"]["properties"]["hawq_rm_nvcore_limit_perseg"], "2")
+    self.assertEquals(configurations["hawq-site"]["properties"]["hawq_rm_nvcore_limit_perseg"], "16")
 
     # Case 2:
-    # HAWQ Hosts Core Count: c6401.ambari.apache.org - 2, c6402.ambari.apache.org - 2, c6404.ambari.apache.org - 2
+    # HAWQ Hosts Core Count: c6401.ambari.apache.org - 2, c6402.ambari.apache.org - 4, c6404.ambari.apache.org - 2
+    # hawq_global_rm_type: none
     # Non HAWQ Hosts Core Count: c6401.ambari.apache.org - 1
-    # Recommend hawq_rm_nvcore_limit_perseg as 2
-    hosts["items"][1]["Hosts"]["cpu_count"] = 2
+    # Recommend hawq_rm_nvcore_limit_perseg when rm type is none
+    configurations["hawq-site"]["properties"]["hawq_global_rm_type"] = "none"
     self.serviceAdvisor.getServiceConfigurationRecommendations(self.stackAdvisor, configurations, None, services, hosts)
     self.assertEquals(configurations["hawq-site"]["properties"]["hawq_rm_nvcore_limit_perseg"], "2")