ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-19114. Add property existence check to druid stack advisor code (Nishant Bangarwa via smohanty)
Date Fri, 09 Dec 2016 14:58:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk a8222ae3b -> c8ae4b415


AMBARI-19114. Add property existence check to druid stack advisor code (Nishant Bangarwa via
smohanty)


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

Branch: refs/heads/trunk
Commit: c8ae4b4157df72e735457e0a62d9197742e7f150
Parents: a8222ae
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Fri Dec 9 06:58:15 2016 -0800
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Fri Dec 9 06:58:46 2016 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.6/services/stack_advisor.py    |  4 ++
 .../stacks/2.6/common/test_stack_advisor.py     | 52 ++++++++++++++++++++
 2 files changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c8ae4b41/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
index bebeaf8..562444b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
@@ -53,6 +53,10 @@ class HDP26StackAdvisor(HDP25StackAdvisor):
 
   def recommendDruidConfigurations(self, configurations, clusterData, services, hosts):
 
+      # druid is not in list of services to be installed
+      if 'druid-common' not in services['configurations']:
+        return
+
       componentsListList = [service["components"] for service in services["services"]]
       componentsList = [item["StackServiceComponents"] for sublist in componentsListList
for item in sublist]
       servicesList = [service["StackServices"]["service_name"] for service in services["services"]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8ae4b41/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
index 011a874..074d87e 100644
--- a/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
@@ -424,6 +424,58 @@ class TestHDP26StackAdvisor(TestCase):
                                                               'druid.broker.jvm.heap.memory':
{'maximum': '49152'}}}}
                       )
 
+
+  def test_recommendDruidConfigurations_property_existence_check(self):
+      # Test for https://issues.apache.org/jira/browse/AMBARI-19144
+      hosts = {
+        "items": [
+          {
+            "Hosts": {
+              "cpu_count": 4,
+              "total_mem": 50331648,
+              "disk_info": [
+                {"mountpoint": "/"},
+                {"mountpoint": "/dev/shm"},
+                {"mountpoint": "/vagrant"},
+                {"mountpoint": "/"},
+                {"mountpoint": "/dev/shm"},
+                {"mountpoint": "/vagrant"}
+              ],
+              "public_host_name": "c6401.ambari.apache.org",
+              "host_name": "c6401.ambari.apache.org"
+            }
+          }
+        ]
+      }
+
+      services = {
+        "Versions": {
+          "parent_stack_version": "2.5",
+          "stack_name": "HDP",
+          "stack_version": "2.6",
+          "stack_hierarchy": {
+            "stack_name": "HDP",
+            "stack_versions": ["2.5", "2.4", "2.3", "2.2", "2.1", "2.0.6"]
+          }
+        },
+        "services": [{
+        }
+        ],
+        "configurations": {
+        }
+      }
+
+      clusterData = {
+      }
+
+      configurations = {
+      }
+
+      self.stackAdvisor.recommendDruidConfigurations(configurations, clusterData, services,
hosts)
+      self.assertEquals(configurations,
+                        {}
+                        )
+
   def test_recommendDruidConfigurations_heterogeneous_hosts(self):
     hosts = {
       "items": [


Mime
View raw message