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

ambari git commit: AMBARI-13231: Change default values from SQLA to SQL Anywhere (jluniya)

Repository: ambari
Updated Branches:
  refs/heads/trunk d66b4de05 -> eb2e61585


AMBARI-13231: Change default values from SQLA to SQL Anywhere (jluniya)


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

Branch: refs/heads/trunk
Commit: eb2e61585e491555d214103ecbef53b2d0819fe0
Parents: d66b4de
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Thu Sep 24 12:00:29 2015 -0700
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Thu Sep 24 12:00:29 2015 -0700

----------------------------------------------------------------------
 .../pluggable_stack_definition/configs/SAPHD.json       |  4 ++--
 .../ambari/server/topology/BlueprintValidatorImpl.java  |  8 ++++----
 .../HDP/2.3/services/HIVE/configuration/hive-site.xml   |  2 +-
 .../resources/stacks/HDP/2.3/services/stack_advisor.py  |  8 ++++----
 .../server/topology/BlueprintValidatorImplTest.java     |  8 ++++----
 .../stacks/2.0.6/configs/oozie_existing_sqla.json       |  2 +-
 .../test/python/stacks/2.1/HIVE/test_hive_metastore.py  |  4 ++--
 ambari-web/app/data/HDP2.3/site_properties.js           |  2 +-
 ambari-web/app/data/db_properties_info.js               |  7 +++++++
 ambari-web/app/views/common/controls_view.js            | 12 ++++++++----
 10 files changed, 34 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json b/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json
index 3ef46d8..27c6995 100644
--- a/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json
+++ b/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json
@@ -34,7 +34,7 @@
               "name": "hive-env",
               "properties": {
                 "hive_database_type": "sqlanywhere",
-                "hive_database": "Existing SQLA Database"
+                "hive_database": "Existing SQL Anywhere Database"
               }
             },
             {
@@ -57,7 +57,7 @@
             {
               "name": "oozie-env",
               "properties": {
-                "oozie_database": "Existing SQLA Database"
+                "oozie_database": "Existing SQL Anywhere Database"
               }
             },
             {

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java
index 1b3a910..9e8f163 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java
@@ -103,10 +103,10 @@ public class BlueprintValidatorImpl implements BlueprintValidator {
         if (component.equals("HIVE_METASTORE")) {
           Map<String, String> hiveEnvConfig = clusterConfigurations.get("hive-env");
           if (hiveEnvConfig != null && !hiveEnvConfig.isEmpty() && hiveEnvConfig.get("hive_database") !=null
-                  && hiveEnvConfig.get("hive_database").equals("Existing SQLA Database")
+                  && hiveEnvConfig.get("hive_database").equals("Existing SQL Anywhere Database")
                   && VersionUtils.compareVersions(stack.getVersion(), "2.3.0.0") < 0
                   && stack.getName().equalsIgnoreCase("HDP")) {
-            throw new InvalidTopologyException("Incorrect configuration: SQLA db is available only for stack HDP-2.3+ " +
+            throw new InvalidTopologyException("Incorrect configuration: SQL Anywhere db is available only for stack HDP-2.3+ " +
                     "and repo version 2.3.2+!");
           }
         }
@@ -114,10 +114,10 @@ public class BlueprintValidatorImpl implements BlueprintValidator {
         if (component.equals("OOZIE_SERVER")) {
           Map<String, String> oozieEnvConfig = clusterConfigurations.get("oozie-env");
           if (oozieEnvConfig != null && !oozieEnvConfig.isEmpty() && oozieEnvConfig.get("oozie_database") !=null
-                  && oozieEnvConfig.get("oozie_database").equals("Existing SQLA Database")
+                  && oozieEnvConfig.get("oozie_database").equals("Existing SQL Anywhere Database")
                   && VersionUtils.compareVersions(stack.getVersion(), "2.3.0.0") < 0
                   && stack.getName().equalsIgnoreCase("HDP")) {
-            throw new InvalidTopologyException("Incorrect configuration: SQLA db is available only for stack HDP-2.3+ " +
+            throw new InvalidTopologyException("Incorrect configuration: SQL Anywhere db is available only for stack HDP-2.3+ " +
                     "and repo version 2.3.2+!");
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/hive-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/hive-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/hive-site.xml
index 700c958..5d0f5e0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/hive-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/hive-site.xml
@@ -31,7 +31,7 @@ limitations under the License.
 
   <property>
     <name>datanucleus.rdbms.datastoreAdapterClassName</name>
-    <description>Datanucleus Class, This property used only when hive db is SQLA</description>
+    <description>Datanucleus Class, This property used only when hive db is SQL Anywhere</description>
     <depends-on>
       <property>
         <type>hive-env</type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/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 16fb7a5..adb6689 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
@@ -182,7 +182,7 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 
     # if hive using sqla db, then we should add DataNucleus property
     sqla_db_used = 'hive-env' in services['configurations'] and 'hive_database' in services['configurations']['hive-env']['properties'] and \
-                   services['configurations']['hive-env']['properties']['hive_database'] == 'Existing SQLA Database'
+                   services['configurations']['hive-env']['properties']['hive_database'] == 'Existing SQL Anywhere Database'
     if sqla_db_used:
       putHiveSiteProperty('datanucleus.rdbms.datastoreAdapterClassName','org.datanucleus.store.rdbms.adapter.SQLAnywhereAdapter')
     else:
@@ -309,19 +309,19 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
     hive_env_properties = getSiteProperties(configurations, "hive-env")
     validationItems = []
     sqla_db_used = "hive_database" in hive_env_properties and \
-                   hive_env_properties['hive_database'] == 'Existing SQLA Database'
+                   hive_env_properties['hive_database'] == 'Existing SQL Anywhere Database'
     prop_name = "datanucleus.rdbms.datastoreAdapterClassName"
     prop_value = "org.datanucleus.store.rdbms.adapter.SQLAnywhereAdapter"
     if sqla_db_used:
       if not prop_name in hive_site:
         validationItems.append({"config-name": prop_name,
                               "item": self.getWarnItem(
-                              "If Hive using SQLA db." \
+                              "If Hive using SQL Anywhere db." \
                               " {0} needs to be added with value {1}".format(prop_name,prop_value))})
       elif prop_name in hive_site and hive_site[prop_name] != "org.datanucleus.store.rdbms.adapter.SQLAnywhereAdapter":
         validationItems.append({"config-name": prop_name,
                                 "item": self.getWarnItem(
-                                  "If Hive using SQLA db." \
+                                  "If Hive using SQL Anywhere db." \
                                   " {0} needs to be set to {1}".format(prop_name,prop_value))})
     return self.toConfigurationValidationProblems(validationItems, "hive-site")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java
index cc2b189..8ab4ba1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java
@@ -181,8 +181,8 @@ public class BlueprintValidatorImplTest{
 
   @Test(expected=InvalidTopologyException.class)
   public void testValidateRequiredProperties_SqlaInHiveStackHdp22() throws Exception {
-    Map<String, String> hiveEnvConfig = new HashMap<>();
-    hiveEnvConfig.put("hive_database","Existing SQLA Database");
+    Map<String, String> hiveEnvConfig = new HashMap<String, String>();
+    hiveEnvConfig.put("hive_database","Existing SQL Anywhere Database");
     configProperties.put("hive-env", hiveEnvConfig);
 
     group1Components.add("HIVE_METASTORE");
@@ -204,8 +204,8 @@ public class BlueprintValidatorImplTest{
 
   @Test(expected=InvalidTopologyException.class)
   public void testValidateRequiredProperties_SqlaInOozieStackHdp22() throws Exception {
-    Map<String, String> hiveEnvConfig = new HashMap<>();
-    hiveEnvConfig.put("oozie_database","Existing SQLA Database");
+    Map<String, String> hiveEnvConfig = new HashMap<String, String>();
+    hiveEnvConfig.put("oozie_database","Existing SQL Anywhere Database");
     configProperties.put("oozie-env", hiveEnvConfig);
 
     group1Components.add("OOZIE_SERVER");

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-server/src/test/python/stacks/2.0.6/configs/oozie_existing_sqla.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/oozie_existing_sqla.json b/ambari-server/src/test/python/stacks/2.0.6/configs/oozie_existing_sqla.json
index 30adf0e..01856df 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/oozie_existing_sqla.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/oozie_existing_sqla.json
@@ -553,7 +553,7 @@
             "content": "\n#!/bin/bash\n\nif [ -d \"/usr/lib/bigtop-tomcat\" ]; then\n  export OOZIE_CONFIG=${OOZIE_CONFIG:-/etc/oozie/conf}\n  export CATALINA_BASE=${CATALINA_BASE:-/var/lib/oozie/oozie-server}\n  export CATALINA_TMPDIR=${CATALINA_TMPDIR:-/var/tmp/oozie}\n  export OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat\nfi\n\n#Set JAVA HOME\nexport JAVA_HOME={{java_home}}\n\nexport JRE_HOME=${JAVA_HOME}\n\n# Set Oozie specific environment variables here.\n\n# Settings for the Embedded Tomcat that runs Oozie\n# Java System properties for Oozie should be specified in this variable\n#\n# export CATALINA_OPTS=\n\n# Oozie configuration file to load from Oozie configuration directory\n#\n# export OOZIE_CONFIG_FILE=oozie-site.xml\n\n# Oozie logs directory\n#\nexport OOZIE_LOG={{oozie_log_dir}}\n\n# Oozie pid directory\n#\nexport CATALINA_PID={{pid_file}}\n\n#Location of the data for oozie\nexport OOZIE_DATA={{oozie_data_dir}}\n\n# Oozie Log4J configuration file to load from Oozie config
 uration directory\n#\n# export OOZIE_LOG4J_FILE=oozie-log4j.properties\n\n# Reload interval of the Log4J configuration file, in seconds\n#\n# export OOZIE_LOG4J_RELOAD=10\n\n# The port Oozie server runs\n#\nexport OOZIE_HTTP_PORT={{oozie_server_port}}\n\n# The admin port Oozie server runs\n#\nexport OOZIE_ADMIN_PORT={{oozie_server_admin_port}}\n\n# The host name Oozie server runs on\n#\n# export OOZIE_HTTP_HOSTNAME=`hostname -f`\n\n# The base URL for callback URLs to Oozie\n#\n# export OOZIE_BASE_URL=\"http://${OOZIE_HTTP_HOSTNAME}:${OOZIE_HTTP_PORT}/oozie\"\nexport JAVA_LIBRARY_PATH=/usr/lib/hadoop/lib/native/Linux-amd64-64",
             "oozie_user": "oozie",
             "oozie_admin_users": "{oozie_user}, {oozie_user}-admin",
-            "oozie_database": "Existing SQLA Database",
+            "oozie_database": "Existing SQL Anywhere Database",
             "oozie_data_dir": "/hadoop/oozie/data",
             "oozie_log_dir": "/var/log/oozie"
         },

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
index 8c8795c..c5566a8 100644
--- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
@@ -607,7 +607,7 @@ class TestHiveMetastore(RMFTestCase):
     # trigger the code to think it needs to copy the JAR
     json_content['configurations']['hive-site']['javax.jdo.option.ConnectionDriverName'] = "sap.jdbc4.sqlanywhere.IDriver"
     json_content['configurations']['hive-env']['hive_database'] = "Existing"
-    json_content['configurations']['hive-env']['hive_database_type'] = "sqla"
+    json_content['configurations']['hive-env']['hive_database_type'] = "sqlanywhere"
 
     mocks_dict = {}
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_metastore.py",
@@ -667,7 +667,7 @@ class TestHiveMetastore(RMFTestCase):
                               mode = 0644,
                               )
 
-    self.assertResourceCalled('Execute', "/usr/hdp/2.3.0.0-1234/hive/bin/schematool -dbType sqla -upgradeSchema",
+    self.assertResourceCalled('Execute', "/usr/hdp/2.3.0.0-1234/hive/bin/schematool -dbType sqlanywhere -upgradeSchema",
                               logoutput = True, environment = {'HIVE_CONF_DIR': '/usr/hdp/current/hive-server2/conf/conf.server'},
                               tries = 1, user = 'hive')
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-web/app/data/HDP2.3/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2.3/site_properties.js b/ambari-web/app/data/HDP2.3/site_properties.js
index 4ea661d..adf8cae 100644
--- a/ambari-web/app/data/HDP2.3/site_properties.js
+++ b/ambari-web/app/data/HDP2.3/site_properties.js
@@ -82,7 +82,7 @@ hdp23properties.push({
         displayName: 'MSSQL'
       },
       {
-        displayName: 'SQL Anywhere',
+        displayName: 'SQLA',
         hidden: App.get('currentStackName') !== 'SAPHD' && App.get('currentStackName') !== 'HDP'
       }
     ],

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-web/app/data/db_properties_info.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/db_properties_info.js b/ambari-web/app/data/db_properties_info.js
index 6ee7770..7d6d2f2 100644
--- a/ambari-web/app/data/db_properties_info.js
+++ b/ambari-web/app/data/db_properties_info.js
@@ -98,6 +98,13 @@ module.exports = {
       'sql_jar_connector': '/usr/share/java/sqljdbc4.jar',
       'db_type': 'mssql'
     },
+    /** TODO: Remove SQLA from the list of databases once Ranger DB_FLAVOR=SQLA is replaced with SQL Anywhere */
+    'SQLA': {
+      'connection_url': 'jdbc:sqlanywhere:host={0};database={1}',
+      'driver': 'sap.jdbc4.sqlanywhere.IDriver',
+      'sql_jar_connector': '/path_to_driver/sqla-client-jdbc.tar.gz',
+      'db_type': 'sqlanywhere'
+    },
     'ANYWHERE': {
       'connection_url': 'jdbc:sqlanywhere:host={0};database={1}',
       'driver': 'sap.jdbc4.sqlanywhere.IDriver',

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb2e6158/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index e079b57..8d1365a 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -481,7 +481,8 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
    */
   getDbTypeFromRadioValue: function() {
     var currentValue = this.get('serviceConfig.value');
-    var databases = /MySQL|Postgres|Oracle|Derby|MSSQL|Anywhere/gi;
+    /** TODO: Remove SQLA from the list of databases once Ranger DB_FLAVOR=SQLA is replaced with SQL Anywhere */
+    var databases = /MySQL|Postgres|Oracle|Derby|MSSQL|SQLA|Anywhere/gi;
     if (this.get('inMSSQLWithIA')) {
       return 'MSSQL2';
     } else {
@@ -649,9 +650,11 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
     }
     var handledProperties = ['oozie_database', 'hive_database', 'DB_FLAVOR'];
     var currentValue = this.get('serviceConfig.value');
-    var databases = /MySQL|PostgreSQL|Postgres|Oracle|Derby|MSSQL|Anywhere/gi;
+    /** TODO: Remove SQLA from the list of databases once Ranger DB_FLAVOR=SQLA is replaced with SQL Anywhere */
+    var databases = /MySQL|PostgreSQL|Postgres|Oracle|Derby|MSSQL|SQLA|Anywhere/gi;
     var currentDB = currentValue.match(databases)[0];
-    var databasesTypes = /MySQL|Postgres|Oracle|Derby|MSSQL|Anywhere/gi;
+    /** TODO: Remove SQLA from the list of databases once Ranger DB_FLAVOR=SQLA is replaced with SQL Anywhere */
+    var databasesTypes = /MySQL|Postgres|Oracle|Derby|MSSQL|SQLA|Anywhere/gi;
     var currentDBType = currentValue.match(databasesTypes)[0];
     var checkDatabase = /existing/gi.test(currentValue);
     // db connection check button show up if existed db selected
@@ -1110,7 +1113,8 @@ App.CheckDBConnectionView = Ember.View.extend({
 
     if (this.get('parentView.service.serviceName') === 'RANGER') {
       var dbFlavor = this.get('parentView.categoryConfigsAll').findProperty('name','DB_FLAVOR').get('value'),
-        databasesTypes = /MYSQL|POSTGRES|ORACLE|MSSQL|Anywhere/gi,
+        /** TODO: Remove SQLA from the list of databases once Ranger DB_FLAVOR=SQLA is replaced with SQL Anywhere */
+        databasesTypes = /MYSQL|POSTGRES|ORACLE|MSSQL|SQLA|Anywhere/gi,
         dbType = dbFlavor.match(databasesTypes)?dbFlavor.match(databasesTypes)[0].toLowerCase():'';
 
       if (dbType==='oracle') {