You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2016/08/19 04:45:39 UTC
ambari git commit: Revert "AMBARI-18157: Hive service check is
failing after cluster Kerberization (jluniya)"
Repository: ambari
Updated Branches:
refs/heads/branch-2.4 2d6ade5a2 -> ed7b203a2
Revert "AMBARI-18157: Hive service check is failing after cluster Kerberization (jluniya)"
This reverts commit f5b3c238b84c4225603412d69b46bcc8243d56fb.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ed7b203a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ed7b203a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ed7b203a
Branch: refs/heads/branch-2.4
Commit: ed7b203a2e5568c8f1cea751317f3bfb42a64985
Parents: 2d6ade5
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu Aug 18 21:45:30 2016 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Aug 18 21:45:30 2016 -0700
----------------------------------------------------------------------
.../stacks/HDP/2.0.6/services/stack_advisor.py | 91 --------------------
.../stacks/HDP/2.1/services/stack_advisor.py | 20 +----
.../stacks/2.0.6/common/test_stack_advisor.py | 53 ------------
3 files changed, 1 insertion(+), 163 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7b203a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 047f3b2..419c91b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -1676,97 +1676,6 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
leafQueueNames.add(leafQueueName)
return leafQueueNames
- def get_service_component_meta(self, service, component, services):
- """
- Function retrieve service component meta information as dict from services.json
- If no service or component found, would be returned empty dict
-
- Return value example:
- "advertise_version" : true,
- "bulk_commands_display_name" : "",
- "bulk_commands_master_component_name" : "",
- "cardinality" : "1+",
- "component_category" : "CLIENT",
- "component_name" : "HBASE_CLIENT",
- "custom_commands" : [ ],
- "decommission_allowed" : false,
- "display_name" : "HBase Client",
- "has_bulk_commands_definition" : false,
- "is_client" : true,
- "is_master" : false,
- "reassign_allowed" : false,
- "recovery_enabled" : false,
- "service_name" : "HBASE",
- "stack_name" : "HDP",
- "stack_version" : "2.5",
- "hostnames" : [ "host1", "host2" ]
-
- :type service str
- :type component str
- :type services dict
- :rtype dict
- """
- __stack_services = "StackServices"
- __stack_service_components = "StackServiceComponents"
-
- if not services:
- return {}
-
- service_meta = [item for item in services["services"] if item[__stack_services]["service_name"] == service]
- if len(service_meta) == 0:
- return {}
-
- service_meta = service_meta[0]
- component_meta = [item for item in service_meta["components"] if item[__stack_service_components]["component_name"] == component]
-
- if len(component_meta) == 0:
- return {}
-
- return component_meta[0][__stack_service_components]
-
- def is_secured_cluster(self, services):
- """
- Detects if cluster is secured or not
- :type services dict
- :rtype bool
- """
- return services and "cluster-env" in services["configurations"] and\
- "security_enabled" in services["configurations"]["cluster-env"]["properties"] and\
- services["configurations"]["cluster-env"]["properties"]["security_enabled"].lower() == "true"
-
- def get_services_list(self, services):
- """
- Returns available services as list
-
- :type services dict
- :rtype list
- """
- if not services:
- return []
-
- return [service["StackServices"]["service_name"] for service in services["services"]]
-
- def get_components_list(self, service, services):
- """
- Return list of components for specific service
- :type service str
- :type services dict
- :rtype list
- """
- __stack_services = "StackServices"
- __stack_service_components = "StackServiceComponents"
-
- if not services:
- return []
-
- service_meta = [item for item in services["services"] if item[__stack_services]["service_name"] == service]
- if len(service_meta) == 0:
- return []
-
- service_meta = service_meta[0]
- return [item[__stack_service_components]["component_name"] for item in service_meta["components"]]
-
-
def getOldValue(self, services, configType, propertyName):
if services:
if 'changed-configurations' in services.keys():
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7b203a/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 e194b3f..34b4614 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
@@ -107,7 +107,7 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
dbConnection = self.getDBConnectionString(hiveEnvProperties['hive_database']).format(hiveServerHost['Hosts']['host_name'], hiveSiteProperties['ambari.hive.db.schema.name'])
putHiveProperty('javax.jdo.option.ConnectionURL', dbConnection)
- servicesList = self.get_services_list(services)
+ servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
if "PIG" in servicesList:
ambari_user = self.getAmbariUser(services)
ambariHostName = socket.getfqdn()
@@ -120,24 +120,6 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
webHcatSitePropertyAttributes("webhcat.proxyuser.{0}.hosts".format(old_ambari_user), 'delete', 'true')
webHcatSitePropertyAttributes("webhcat.proxyuser.{0}.groups".format(old_ambari_user), 'delete', 'true')
- if self.is_secured_cluster(services):
- appendCoreSiteProperty = self.updateProperty(configurations, "core-site", services)
-
- def updateCallback(originalValue, newValue):
- if originalValue and not originalValue.isspace():
- hosts = originalValue.split(',')
-
- if newValue:
- hosts.extend(newValue)
-
- result = ','.join(set(hosts))
- return result
- else:
- return newValue
-
- meta = self.get_service_component_meta("HIVE", "WEBHCAT_SERVER", services)
- if "hostnames" in meta:
- appendCoreSiteProperty('hadoop.proxyuser.HTTP.hosts', meta["hostnames"], updateCallback)
def recommendTezConfigurations(self, configurations, clusterData, services, hosts):
putTezProperty = self.putProperty(configurations, "tez-site")
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7b203a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index a70922f..e28389e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -188,59 +188,6 @@ class TestHDP206StackAdvisor(TestCase):
]
self.assertValidationResult(expectedItems, result)
- def test_get_components_list(self):
- servicesInfo = [
- {
- "name": "GANGLIA",
- "components": [
- {"name": "GANGLIA_MONITOR", "display_name": "Ganglia Monitor", "cardinality": "1+", "category": "SLAVE", "is_master": False, "hostnames": ["host1"]},
- {"name": "GANGLIA_SERVER", "display_name": "Ganglia Server", "cardinality": "3+", "category": "MASTER", "is_master": True, "hostnames": ["host2", "host1"]}
- ]
- }
- ]
- expected = sorted(["GANGLIA_MONITOR", "GANGLIA_SERVER"])
-
- services = self.prepareServices(servicesInfo)
- result = sorted(self.stackAdvisor.get_components_list("GANGLIA", services))
-
- self.assertEqual(expected, result)
-
- def test_get_services_list(self):
- servicesInfo = [
- {
- "name": "GANGLIA",
- "components": [
- {"name": "GANGLIA_MONITOR", "display_name": "Ganglia Monitor", "cardinality": "1+", "category": "SLAVE", "is_master": False, "hostnames": ["host1"]},
- {"name": "GANGLIA_SERVER", "display_name": "Ganglia Server", "cardinality": "3+", "category": "MASTER", "is_master": True, "hostnames": ["host2", "host1"]}
- ]
- }
- ]
- expected = ["GANGLIA"]
-
- services = self.prepareServices(servicesInfo)
- result = self.stackAdvisor.get_services_list(services)
-
- self.assertEqual(expected, result)
-
- def test_get_service_component_meta(self):
- servicesInfo = [
- {
- "name": "GANGLIA",
- "components": [
- {"name": "GANGLIA_MONITOR", "display_name": "Ganglia Monitor", "cardinality": "1+", "category": "SLAVE", "is_master": False, "hostnames": ["host1"]},
- {"name": "GANGLIA_SERVER", "display_name": "Ganglia Server", "cardinality": "3+", "category": "MASTER", "is_master": True, "hostnames": ["host2", "host1"]}
- ]
- }
- ]
- expected = ["host1"]
-
- services = self.prepareServices(servicesInfo)
- result = self.stackAdvisor.get_service_component_meta("GANGLIA", "GANGLIA_MONITOR", services)
-
- self.assertEquals(True, "hostnames" in result)
- self.assertEqual(expected, result["hostnames"])
-
-
def test_validationWarnMessagesIfLessThanDefault(self):
servicesInfo = [
{