ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject [39/50] [abbrv] ambari git commit: AMBARI-22017 stack advisor recommends all components on single host for HDP-2.6 Ambari trunk build (dsen)
Date Tue, 26 Sep 2017 05:20:30 GMT
AMBARI-22017 stack advisor recommends all components on single host for HDP-2.6 Ambari trunk
build (dsen)


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

Branch: refs/heads/branch-feature-AMBARI-14714
Commit: 999daefe0f09b92f42e50ff12f66dd95a112a003
Parents: 986a65d
Author: Dmytro Sen <dsen@apache.org>
Authored: Mon Sep 25 16:39:09 2017 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Mon Sep 25 16:39:09 2017 +0300

----------------------------------------------------------------------
 .../stacks/HDP/2.1/services/stack_advisor.py    |  4 +++
 .../stacks/2.1/common/test_stack_advisor.py     | 28 ++++++++++++++++++++
 2 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/999daefe/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
index ddd795f..aefb603 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py
@@ -86,6 +86,10 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
 
     Must be overriden in child class.
     """
+
+    # since old stack advisors are extending each other they should call parent method first
+    super(HDP21StackAdvisor, self).modifyComponentLayoutSchemes()
+
     self.componentLayoutSchemes.update({
       'APP_TIMELINE_SERVER': {31: 1, "else": 2},
       'FALCON_SERVER': {6: 1, 31: 2, "else": 3}

http://git-wip-us.apache.org/repos/asf/ambari/blob/999daefe/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py
index bdd34fc..6bd02bf 100644
--- a/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py
@@ -557,3 +557,31 @@ class TestHDP21StackAdvisor(TestCase):
 
     res = self.stackAdvisor.validateHiveConfigurations(properties, recommendedDefaults, configurations,
'', '')
     self.assertEquals(res, res_expected)
+
+  def test_modifyComponentLayoutSchemes(self):
+    res_expected = {}
+    res_expected.update({
+      'NAMENODE': {"else": 0},
+      'SECONDARY_NAMENODE': {"else": 1},
+      'HBASE_MASTER': {6: 0, 31: 2, "else": 3},
+
+      'HISTORYSERVER': {31: 1, "else": 2},
+      'RESOURCEMANAGER': {31: 1, "else": 2},
+
+      'OOZIE_SERVER': {6: 1, 31: 2, "else": 3},
+
+      'HIVE_SERVER': {6: 1, 31: 2, "else": 4},
+      'HIVE_METASTORE': {6: 1, 31: 2, "else": 4},
+      'WEBHCAT_SERVER': {6: 1, 31: 2, "else": 4},
+      'METRICS_COLLECTOR': {3: 2, 6: 2, 31: 3, "else": 5},
+    })
+
+    res_expected.update({
+      'APP_TIMELINE_SERVER': {31: 1, "else": 2},
+      'FALCON_SERVER': {6: 1, 31: 2, "else": 3}
+    })
+
+    self.stackAdvisor.modifyComponentLayoutSchemes()
+    res = self.stackAdvisor.getComponentLayoutSchemes()
+
+    self.assertEquals(res, res_expected)


Mime
View raw message