You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2015/09/11 09:09:24 UTC

ambari git commit: AMBARI-12978. some atlas service properties are not properly displayed by UI (Jonathan Maron via srimanth)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a000b577e -> 219501f82


AMBARI-12978. some atlas service properties are not properly displayed by UI (Jonathan Maron via srimanth)


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

Branch: refs/heads/branch-2.1
Commit: 219501f82f5d91795e14580b9830c2f11463b2dc
Parents: a000b57
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Fri Sep 11 00:07:23 2015 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Fri Sep 11 00:07:23 2015 -0700

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/configuration/hive-site.xml | 22 +++++++++
 .../0.12.0.2.0/package/scripts/params_linux.py  | 18 -------
 .../services/HIVE/configuration/hive-site.xml   |  4 ++
 .../stacks/HDP/2.3/services/stack_advisor.py    | 51 ++++++++++++++++++++
 .../stacks/2.3/common/test_stack_advisor.py     |  2 +
 5 files changed, 79 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/219501f8/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
index f4e4b25..2783b78 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
@@ -372,4 +372,26 @@ limitations under the License.
       </entries>
     </value-attributes>
   </property>
+
+  <property require-input="true">
+    <name>atlas.cluster.name</name>
+    <value></value>
+  </property>
+
+  <property>
+    <name>atlas.rest.address</name>
+    <value>http://localhost:21000</value>
+    <depends-on>
+      <property>
+        <type>application-properties</type>
+        <name>atlas.enableTLS</name>
+      </property>
+      <property>
+        <type>atlas-env</type>
+        <name>metadata_port</name>
+      </property>
+    </depends-on>
+  </property>
+
+
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/219501f8/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index affee98..08906cb 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -408,24 +408,6 @@ if not has_atlas:
   hive_exclude_packages.append(atlas_plugin_package)
   hive_exclude_packages.append(atlas_ubuntu_plugin_package)
 else:
-  # hive-site
-  hive_site_config['atlas.cluster.name'] = config['clusterName']
-  atlas_config = config['configurations']['application-properties']
-  metadata_port = config['configurations']['atlas-env']['metadata_port']
-  metadata_host = atlas_hosts[0]
-  tls_enabled = config['configurations']['application-properties']['atlas.enableTLS']
-  if tls_enabled:
-    scheme = "https"
-  else:
-    scheme = "http"
-  hive_site_config['atlas.rest.address'] = format('{scheme}://{metadata_host}:{metadata_port}')
-
-  if not 'hive.exec.post.hooks' in hive_site_config:
-    hive_site_config['hive.exec.post.hooks'] = 'org.apache.atlas.hive.hook.HiveHook'
-  else:
-    current_hook = hive_site_config['hive.exec.post.hooks']
-    hive_site_config['hive.exec.post.hooks'] =  format('{current_hook}, org.apache.atlas.hive.hook.HiveHook')
-
   # client.properties
   atlas_client_props = {}
   auth_enabled = config['configurations']['application-properties'].get(

http://git-wip-us.apache.org/repos/asf/ambari/blob/219501f8/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index d29c6a6..5811e4f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -229,6 +229,10 @@ limitations under the License.
         <type>hive-env</type>
         <name>hive_timeline_logging_enabled</name>
       </property>
+      <property>
+        <type>atlast-env</type>
+        <name>metadata_port</name>
+      </property>
     </depends-on>
   </property>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219501f8/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 c65e110..dd287b2 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
@@ -187,6 +187,57 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
     else:
       putHiveSitePropertyAttribute('datanucleus.rdbms.datastoreAdapterClassName', 'delete', 'true')
 
+    # atlas
+    hooks_property = "hive.exec.post.hooks"
+    if hooks_property in configurations["hive-site"]["properties"]:
+      hooks_value = configurations["hive-site"]["properties"][hooks_property]
+    else:
+      hooks_value = " "
+
+    include_atlas = "ATLAS" in servicesList
+    atlas_hook_class = "org.apache.atlas.hive.hook.HiveHook"
+    if include_atlas and atlas_hook_class not in hooks_value:
+      if hooks_value == " ":
+        hooks_value = atlas_hook_class
+      else:
+        hooks_value = hooks_value + "," + atlas_hook_class
+    if not include_atlas and atlas_hook_class in hooks_value:
+      hooks_classes = []
+      for hook_class in hooks_value.split(","):
+        if hook_class != atlas_hook_class and hook_class != " ":
+          hooks_classes.append(hook_class)
+      if hooks_classes:
+        hooks_value = ",".join(hooks_classes)
+      else:
+        hooks_value = " "
+    putHiveSiteProperty(hooks_property, hooks_value)
+
+    if include_atlas:
+      cluster_name = ''
+      if 'hive-site' in services['configurations']:
+        if 'atlas.cluster.name' in services['configurations']['hive-site']['properties']:
+          cluster_name = services['configurations']['hive-site']['properties']['atlas.cluster.name']
+          if not cluster_name.strip():
+            # set the cluster name to empty string so that user is prompted for value
+            cluster_name = ''
+
+      putHiveSiteProperty('atlas.cluster.name', cluster_name)
+      metadata_port = "21000"
+      if 'atlas-env' in services['configurations']:
+        metadata_port =  services['configurations']['atlas-env']['properties']['metadata_port']
+      metadata_host_info = self.getHostWithComponent("ATLAS", "ATLAS_SERVER", services, hosts)
+      metadata_host = metadata_host_info['Hosts']['host_name']
+      scheme = "http"
+      if 'application-properties' in services['configurations']:
+        tls_enabled = services['configurations']['application-properties']['properties']['atlas.enableTLS']
+        if tls_enabled.lower() == 'true':
+          scheme = "https"
+      putHiveSiteProperty('atlas.rest.address', '{0}://{1}:{2}'.format(scheme, metadata_host, metadata_port))
+    else:
+      putHiveSitePropertyAttribute('atlas.cluster.name', 'delete', 'true')
+      putHiveSitePropertyAttribute('atlas.rest.address', 'delete', 'true')
+
+
   def recommendHDFSConfigurations(self, configurations, clusterData, services, hosts):
     super(HDP23StackAdvisor, self).recommendHDFSConfigurations(configurations, clusterData, services, hosts)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/219501f8/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index bea7d60..680dcde 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -332,6 +332,8 @@ class TestHDP23StackAdvisor(TestCase):
          'hive.server2.tez.default.queues': {
            'entries': [{'value': 'queue1', 'label': 'queue1 queue'}, {'value': 'queue2', 'label': 'queue2 queue'}]
           },
+         'atlas.cluster.name': {'delete': 'true'},
+         'atlas.rest.address': {'delete': 'true'},
          'datanucleus.rdbms.datastoreAdapterClassName': {'delete': 'true'}
         }
       },