ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vivekratna...@apache.org
Subject ambari git commit: AMBARI-22445. Warn the user appropriately for default MySQL server install for Hive (Part 2) (vsubramanian)
Date Sat, 02 Dec 2017 00:33:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 2640beacb -> 754aa38ec


AMBARI-22445. Warn the user appropriately for default MySQL server install for Hive (Part
2) (vsubramanian)


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

Branch: refs/heads/branch-2.6
Commit: 754aa38eca1cb891f56358e8a95e1c4af15a883c
Parents: 2640bea
Author: Vivek Ratnavel Subramanian <vivekratnavel90@gmail.com>
Authored: Fri Dec 1 16:33:25 2017 -0800
Committer: Vivek Ratnavel Subramanian <vivekratnavel90@gmail.com>
Committed: Fri Dec 1 16:33:25 2017 -0800

----------------------------------------------------------------------
 ambari-web/app/data/HDP2/site_properties.js     |  4 --
 ambari-web/app/data/db_properties_info.js       | 15 +++++--
 ambari-web/app/messages.js                      |  3 ++
 ambari-web/app/views/common/controls_view.js    |  5 ++-
 .../test/views/common/controls_view_test.js     | 46 ++++++++------------
 5 files changed, 36 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/754aa38e/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 6c2d5e1..4d2af4b 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -455,10 +455,6 @@ var hdp2properties = [
       {
         displayName: 'Existing Oracle Database',
         hidden: false
-      },
-      {
-        displayName: 'Existing SQL Anywhere Database',
-        hidden: App.get('currentStackName') !== 'SAPHD' && (App.get('currentStackName')
!== 'HDP' || !App.get('isHadoop23Stack'))
       }
     ],
     "displayType": "radio button",

http://git-wip-us.apache.org/repos/asf/ambari/blob/754aa38e/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 6d93c2a..3b4b856 100644
--- a/ambari-web/app/data/db_properties_info.js
+++ b/ambari-web/app/data/db_properties_info.js
@@ -68,19 +68,28 @@ module.exports = {
       },
       'driver': 'com.mysql.jdbc.Driver',
       'sql_jar_connector': '/usr/share/java/mysql-connector-java.jar',
-      'db_type': 'mysql'
+      'db_type': 'mysql',
+      'db_name': 'MySQL',
+      'driver_download_url': 'https://dev.mysql.com/downloads/connector/j/',
+      'driver_name': 'MySQL Connector/J JDBC Driver'
     },
     'POSTGRES': {
       'connection_url': 'jdbc:postgresql://{0}:5432/{1}',
       'driver': 'org.postgresql.Driver',
       'sql_jar_connector': '/usr/share/java/postgresql.jar',
-      'db_type': 'postgres'
+      'db_type': 'postgres',
+      'db_name': 'PostgreSQL',
+      'driver_download_url': 'https://jdbc.postgresql.org/',
+      'driver_name': 'PostgreSQL JDBC Driver'
     },
     'ORACLE': {
       'connection_url': 'jdbc:oracle:thin:@//{0}:1521/{1}',
       'driver': 'oracle.jdbc.driver.OracleDriver',
       'sql_jar_connector': '/usr/share/java/ojdbc6.jar',
-      'db_type': 'oracle'
+      'db_type': 'oracle',
+      'db_name': 'Oracle',
+      'driver_download_url': 'http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html',
+      'driver_name': 'Oracle JDBC Driver'
     },
     'MSSQL': {
       'connection_url': 'jdbc:sqlserver://{0};databaseName={1}',

http://git-wip-us.apache.org/repos/asf/ambari/blob/754aa38e/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 783baf1..851e331 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2236,6 +2236,9 @@ Em.I18n.translations = {
   'services.service.config.configHistory.makeCurrent.message': 'Created from service config
version {0}',
   'services.service.config.configHistory.comparing': 'Comparing',
   'services.service.config.setRecommendedValue': 'Set Recommended',
+  'services.service.config.database.msg.jdbcSetup.detailed': 'To use {0} with Hive, you must
<a href="{3}" target="_blank">' +
+    'download the {4} from {0}</a>. Once downloaded to the Ambari Server host, run:
<br/>' +
+    '<b>ambari-server setup --jdbc-db={1} --jdbc-driver=/path/to/{1}/{2}</b>',
 
   'services.service.widgets.list-widget.nothingSelected': 'Nothing selected',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/754aa38e/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 74c1e6e..a39f59a 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -743,11 +743,14 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
     var shouldAdditionalViewsBeSet = currentDB && checkDatabase && handledProperties.contains(this.get('serviceConfig.name')),
       driver = this.getDefaultPropertyValue('sql_jar_connector') ? this.getDefaultPropertyValue('sql_jar_connector').split("/").pop()
: 'driver.jar',
       dbType = this.getDefaultPropertyValue('db_type'),
+      dbName = this.getDefaultPropertyValue('db_name'),
+      driverName = this.getDefaultPropertyValue('driver_name'),
+      driverDownloadUrl = this.getDefaultPropertyValue('driver_download_url'),
       additionalView1 = shouldAdditionalViewsBeSet && !this.get('isNewDb') ? App.CheckDBConnectionView.extend({databaseName:
dbType}) : null,
       additionalView2 = shouldAdditionalViewsBeSet ? Ember.View.extend({
         template: Ember.Handlebars.compile('<div class="alert">{{{view.message}}}</div>'),
         message: function() {
-          return Em.I18n.t('services.service.config.database.msg.jdbcSetup').format(dbType,
driver);
+          return Em.I18n.t('services.service.config.database.msg.jdbcSetup.detailed').format(dbName,
dbType, driver, driverDownloadUrl, driverName);
         }.property()
       }) : null;
     if (propertyAppendTo1) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/754aa38e/ambari-web/test/views/common/controls_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/controls_view_test.js b/ambari-web/test/views/common/controls_view_test.js
index 2d18396..682057c 100644
--- a/ambari-web/test/views/common/controls_view_test.js
+++ b/ambari-web/test/views/common/controls_view_test.js
@@ -35,6 +35,9 @@ describe('App.ServiceConfigRadioButtons', function () {
         {
           dbType: 'mysql',
           driver: 'mysql-connector-java.jar',
+          dbName: 'MySQL',
+          downloadUrl: 'https://dev.mysql.com/downloads/connector/j/',
+          driverName: 'MySQL Connector/J JDBC Driver',
           serviceConfig: {
             name: 'hive_database',
             value: 'New MySQL Database',
@@ -65,6 +68,9 @@ describe('App.ServiceConfigRadioButtons', function () {
         {
           dbType: 'postgres',
           driver: 'postgresql.jar',
+          dbName: 'PostgreSQL',
+          downloadUrl: 'https://jdbc.postgresql.org/',
+          driverName: 'PostgreSQL JDBC Driver',
           serviceConfig: {
             name: 'hive_database',
             value: 'Existing PostgreSQL Database',
@@ -95,6 +101,9 @@ describe('App.ServiceConfigRadioButtons', function () {
         {
           dbType: 'derby',
           driver: 'driver.jar',
+          dbName: 'Derby',
+          downloadUrl: 'http://',
+          driverName: 'Derby JDBC Driver',
           serviceConfig: {
             name: 'oozie_database',
             value: 'New Derby Database',
@@ -125,6 +134,9 @@ describe('App.ServiceConfigRadioButtons', function () {
         {
           dbType: 'oracle',
           driver: 'ojdbc6.jar',
+          dbName: 'Oracle',
+          downloadUrl: 'http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html',
+          driverName: 'Oracle JDBC Driver',
           serviceConfig: {
             name: 'oozie_database',
             value: 'Existing Oracle Database',
@@ -155,6 +167,9 @@ describe('App.ServiceConfigRadioButtons', function () {
         {
           dbType: 'mysql',
           driver: 'mysql-connector-java.jar',
+          dbName: 'MySQL',
+          downloadUrl: 'https://dev.mysql.com/downloads/connector/j/',
+          driverName: 'MySQL Connector/J JDBC Driver',
           serviceConfig: {
             name: 'DB_FLAVOR',
             value: 'MYSQL',
@@ -179,34 +194,6 @@ describe('App.ServiceConfigRadioButtons', function () {
           isAdditionalView1Null: true,
           isAdditionalView2Null: true,
           title: 'Ranger, HDP 2.2, external database'
-        },
-        {
-          dbType: 'mssql',
-          driver: 'sqljdbc4.jar',
-          serviceConfig: {
-            name: 'DB_FLAVOR',
-            value: 'MSSQL',
-            serviceName: 'RANGER'
-          },
-          controller: Em.Object.create({
-            selectedService: {
-              configs: [
-                Em.Object.create({
-                  name: 'ranger.jpa.jdbc.url'
-                }),
-                Em.Object.create({
-                  name: 'DB_FLAVOR'
-                })
-              ]
-            }
-          }),
-          currentStackVersion: 'HDP-2.3',
-          rangerVersion: '0.5.0',
-          propertyAppendTo1: 'ranger.jpa.jdbc.url',
-          propertyAppendTo2: 'DB_FLAVOR',
-          isAdditionalView1Null: false,
-          isAdditionalView2Null: false,
-          title: 'Ranger, HDP 2.3, external database'
         }
       ];
     var rangerVersion = '';
@@ -266,7 +253,8 @@ describe('App.ServiceConfigRadioButtons', function () {
 
         if (!item.isAdditionalView2Null) {
           it('additionalView2.message is valid', function () {
-            expect(additionalView2.create().get('message')).to.equal(Em.I18n.t('services.service.config.database.msg.jdbcSetup').format(item.dbType,
item.driver));
+            var message = Em.I18n.t('services.service.config.database.msg.jdbcSetup.detailed').format(item.dbName,
item.dbType, item.driver, item.downloadUrl, item.driverName);
+            expect(additionalView2.create().get('message')).to.equal(message);
           });
         }
 


Mime
View raw message