ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject [4/4] ambari git commit: AMBARI-14301: Co-locate HAWQSEGMENT on hosts that have DATANODE component (lavjain via jaoki)
Date Wed, 06 Jan 2016 01:49:27 GMT
AMBARI-14301: Co-locate HAWQSEGMENT on hosts that have DATANODE component (lavjain via jaoki)


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

Branch: refs/heads/trunk
Commit: fe8a8d1e1626a5a2f294622174f34cb0f65543fe
Parents: c0efc80
Author: Jun Aoki <jaoki@apache.org>
Authored: Tue Jan 5 17:49:14 2016 -0800
Committer: Jun Aoki <jaoki@apache.org>
Committed: Tue Jan 5 17:49:14 2016 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.3/services/stack_advisor.py    |   20 +-
 .../2.3/common/services-hawq-pxf-hdfs.json      | 3490 ++++++++++++++++++
 .../stacks/2.3/common/services-pxf-hdfs.json    | 3490 ------------------
 .../stacks/2.3/common/test_stack_advisor.py     |   15 +-
 4 files changed, 3517 insertions(+), 3498 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fe8a8d1e/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index e52db2c..02c7482 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -26,18 +26,24 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
     parentComponentLayoutRecommendations = super(HDP23StackAdvisor, self).createComponentLayoutRecommendations(services,
hosts)
 
     hostsList = [host["Hosts"]["host_name"] for host in hosts["items"]]
+    hostGroups = parentComponentLayoutRecommendations["blueprint"]["host_groups"]
     servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
 
-    # remove HAWQSTANDBY on a single node
-    if len(hostsList) == 1 and "HAWQ" in servicesList:
-      components = parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"]
-      components = [ component for component in components if component["name"] != 'HAWQSTANDBY'
]
-      parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"] =
components
+    if "HAWQ" in servicesList:
+      # remove HAWQSTANDBY on a single node
+      if len(hostsList) == 1:
+        components = parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"]
+        components = [component for component in components if component["name"] != 'HAWQSTANDBY']
+        parentComponentLayoutRecommendations["blueprint"]["host_groups"][0]["components"]
= components
+
+      # co-locate HAWQSEGMENT with DATANODE
+      for host_group in hostGroups:
+        if {"name": "DATANODE"} in host_group["components"] and {"name": "HAWQSEGMENT"} not
in host_group["components"]:
+          host_group["components"].append({"name": "HAWQSEGMENT"})
 
     # co-locate PXF with NAMENODE and DATANODE
     if "PXF" in servicesList:
-      host_groups = parentComponentLayoutRecommendations["blueprint"]["host_groups"]
-      for host_group in host_groups:
+      for host_group in hostGroups:
         if ({"name": "NAMENODE"} in host_group["components"] or {"name": "DATANODE"} in host_group["components"])
\
             and {"name": "PXF"} not in host_group["components"]:
           host_group["components"].append({"name": "PXF"})


Mime
View raw message