You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2016/04/07 13:37:54 UTC

ambari git commit: AMBARI-15742. Recommendations return 500 error for HIVE with (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 9c3fe327d -> aceeacef6


AMBARI-15742. Recommendations return 500 error for HIVE with (alexantonenko)


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

Branch: refs/heads/trunk
Commit: aceeacef678006493d51d7ad80cf69ab91083433
Parents: 9c3fe32
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Apr 7 13:26:53 2016 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Apr 7 14:37:49 2016 +0300

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/2.1/services/stack_advisor.py    | 3 +++
 .../src/test/python/stacks/2.1/common/test_stack_advisor.py    | 6 ++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/aceeacef/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 660bb74..a46bd92 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
@@ -160,6 +160,7 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
       'NEW MYSQL DATABASE': 'com.mysql.jdbc.Driver',
       'NEW DERBY DATABASE': 'org.apache.derby.jdbc.EmbeddedDriver',
       'EXISTING MYSQL DATABASE': 'com.mysql.jdbc.Driver',
+      'EXISTING MYSQL / MARIADB DATABASE': 'com.mysql.jdbc.Driver',
       'EXISTING POSTGRESQL DATABASE': 'org.postgresql.Driver',
       'EXISTING ORACLE DATABASE': 'oracle.jdbc.driver.OracleDriver',
       'EXISTING SQL ANYWHERE DATABASE': 'sap.jdbc4.sqlanywhere.IDriver'
@@ -171,6 +172,7 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
       'NEW MYSQL DATABASE': 'jdbc:mysql://{0}/{1}?createDatabaseIfNotExist=true',
       'NEW DERBY DATABASE': 'jdbc:derby:${{oozie.data.dir}}/${{oozie.db.schema.name}}-db;create=true',
       'EXISTING MYSQL DATABASE': 'jdbc:mysql://{0}/{1}',
+      'EXISTING MYSQL / MARIADB DATABASE': 'jdbc:mysql://{0}/{1}',
       'EXISTING POSTGRESQL DATABASE': 'jdbc:postgresql://{0}:5432/{1}',
       'EXISTING ORACLE DATABASE': 'jdbc:oracle:thin:@//{0}:1521/{1}',
       'EXISTING SQL ANYWHERE DATABASE': 'jdbc:sqlanywhere:host={0};database={1}'
@@ -181,6 +183,7 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
     driverDict = {
       'NEW MYSQL DATABASE': 'mysql',
       'NEW DERBY DATABASE': 'derby',
+      'EXISTING MYSQL / MARIADB DATABASE': 'mysql',
       'EXISTING MYSQL DATABASE': 'mysql',
       'EXISTING POSTGRESQL DATABASE': 'postgres',
       'EXISTING ORACLE DATABASE': 'oracle',

http://git-wip-us.apache.org/repos/asf/ambari/blob/aceeacef/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 ac4b5f5..4a09f22 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
@@ -255,6 +255,12 @@ class TestHDP21StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionURL'], "jdbc:sqlanywhere:host=example.com;database=hive_name")
     self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionDriverName'], "sap.jdbc4.sqlanywhere.IDriver")
 
+    # existing Mysql / MariaDB
+    services['configurations']['hive-env']['properties']['hive_database'] = 'Existing MySQL / MariaDB Database'
+    self.stackAdvisor.recommendHiveConfigurations(configurations, clusterData, services, hosts)
+    self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionURL'], "jdbc:mysql://example.com/hive_name")
+    self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionDriverName'], "com.mysql.jdbc.Driver")
+
   def test_recommendHiveConfigurations_containersRamIsLess(self):
     configurations = {}
     clusterData = {