ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject ambari git commit: AMBARI-13231: Change default values from SQLA to SQL Anywhere (jluniya)
Date Thu, 24 Sep 2015 19:01:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 da6c1e841 -> fed404f66


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/fed404f6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fed404f6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fed404f6

Branch: refs/heads/branch-2.1
Commit: fed404f66ceb801ab7f847ec0c5d1bddbe2c7bef
Parents: da6c1e8
Author: Jayush Luniya <jluniya@hortonworks.com>
Authored: Thu Sep 24 12:00:29 2015 -0700
Committer: Jayush Luniya <jluniya@hortonworks.com>
Committed: Thu Sep 24 12:01: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/fed404f6/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/fed404f6/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/fed404f6/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/fed404f6/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/fed404f6/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/fed404f6/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/fed404f6/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 6eeacbe..9d42b9f 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/fed404f6/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/fed404f6/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/fed404f6/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 a6e962b..30a84e8 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -480,7 +480,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 {
@@ -648,9 +649,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
@@ -1109,7 +1112,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') {


Mime
View raw message