ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-4438. Make JDBC driver classname config properties visible on hive and oozie service config page. (jaimin)
Date Mon, 27 Jan 2014 22:17:35 GMT
Updated Branches:
  refs/heads/trunk 49eb50fd4 -> 60c16d770


AMBARI-4438. Make JDBC driver classname config properties visible on hive and oozie service
config page. (jaimin)


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

Branch: refs/heads/trunk
Commit: 60c16d770d0fdc9b6fda19310b83978f280e749a
Parents: 49eb50f
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Mon Jan 27 14:16:57 2014 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Mon Jan 27 14:17:04 2014 -0800

----------------------------------------------------------------------
 .../app/controllers/wizard/step8_controller.js  | 25 --------------------
 ambari-web/app/data/HDP2/site_properties.js     | 24 +++++++++++--------
 ambari-web/app/data/site_properties.js          | 24 +++++++++++--------
 ambari-web/app/views/wizard/controls_view.js    | 16 ++++++++++++-
 4 files changed, 43 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/60c16d77/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index b3632fd..ea141bd 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1355,20 +1355,6 @@ App.WizardStep8Controller = Em.Controller.extend({
       oozieProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
       this._recordHostOverrideFromObj(_configProperty, 'oozie-site', 'version1', this);
     }, this);
-    var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet
var');
-    if (globals.someProperty('name', 'oozie_database')) {
-      var oozieDb = globals.findProperty('name', 'oozie_database');
-      if (oozieDb.value === 'New Derby Database') {
-        // oozieProperties["oozie.service.JPAService.jdbc.url"] = "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true";
-        oozieProperties["oozie.service.JPAService.jdbc.driver"] = "org.apache.derby.jdbc.EmbeddedDriver";
-      } else if (oozieDb.value === 'Existing MySQL Database') {
-        // oozieProperties["oozie.service.JPAService.jdbc.url"] = "jdbc:mysql://" + oozieHost
+ "/" + oozieDbName;
-        oozieProperties["oozie.service.JPAService.jdbc.driver"] = "com.mysql.jdbc.Driver";
-      } else { //existing oracle database
-        // oozieProperties["oozie.service.JPAService.jdbc.url"] = "jdbc:oracle:thin:@//"
+ oozieHost + ":1521/" + oozieDbName;
-        oozieProperties["oozie.service.JPAService.jdbc.driver"] = "oracle.jdbc.driver.OracleDriver";
-      }
-    }
     return {type: 'oozie-site', tag: 'version1', properties: oozieProperties};
   },
 
@@ -1379,17 +1365,6 @@ App.WizardStep8Controller = Em.Controller.extend({
       hiveProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
       this._recordHostOverrideFromObj(_configProperty, 'hive-site', 'version1', this);
     }, this);
-    var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet
var');
-    if (globals.someProperty('name', 'hive_database')) {
-      var hiveDb = globals.findProperty('name', 'hive_database');
-      if (hiveDb.value === 'New MySQL Database') {
-        hiveProperties["javax.jdo.option.ConnectionDriverName"] = "com.mysql.jdbc.Driver";
-      } else if (hiveDb.value === 'Existing MySQL Database'){
-        hiveProperties["javax.jdo.option.ConnectionDriverName"] = "com.mysql.jdbc.Driver";
-      } else { //existing oracle database
-        hiveProperties["javax.jdo.option.ConnectionDriverName"] = "oracle.jdbc.driver.OracleDriver";
-      }
-    }
     return {type: 'hive-site', tag: 'version1', properties: hiveProperties};
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c16d77/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 a15fde2..4e7f981 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -400,13 +400,15 @@ module.exports =
     {
       "id": "site property",
       "name": "oozie.service.JPAService.jdbc.driver",
-      "displayName": "JDBC driver class",
+      "displayName": "JDBC Driver Class",
       "defaultValue": "",
       "value": "",     // the value is overwritten in code
-      "isVisible": false,
+      "isVisible": true,
+      "isOverridable": false,
       "description": "Database name used for the Oozie",
-      "category": "Advanced",
-      "serviceName": "OOZIE"
+      "category": "Oozie Server",
+      "serviceName": "OOZIE",
+      "index": 6
     },
     {
       "id": "site property",
@@ -418,20 +420,22 @@ module.exports =
       "displayType": "advanced",
       "category": "Oozie Server",
       "serviceName": "OOZIE",
-      "index": 6
+      "index": 7
     },
 
   /**********************************************hive-site***************************************/
     {
       "id": "site property",
       "name": "javax.jdo.option.ConnectionDriverName",
-      "displayName": "JDBC driver class",
+      "displayName": "JDBC Driver Class",
       "defaultValue": "",
       "value": "",     // the value is overwritten in code
-      "isVisible": false,
+      "isVisible": true,
+      "isOverridable": false,
       "description": "Driver class name for a JDBC metastore",
-      "category": "Advanced",
-      "serviceName": "HIVE"
+      "category": "Hive Metastore",
+      "serviceName": "HIVE",
+      "index": 7
     },
     {
       "id": "site property",
@@ -470,7 +474,7 @@ module.exports =
       "isVisible": true,
       "category": "Hive Metastore",
       "serviceName": "HIVE",
-      "index": 7
+      "index": 8
     },
     {
       "id": "site property",

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c16d77/ambari-web/app/data/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/site_properties.js b/ambari-web/app/data/site_properties.js
index 38c2bd5..368057b 100644
--- a/ambari-web/app/data/site_properties.js
+++ b/ambari-web/app/data/site_properties.js
@@ -390,13 +390,15 @@ module.exports =
     {
       "id": "site property",
       "name": "oozie.service.JPAService.jdbc.driver",
-      "displayName": "JDBC driver class",
+      "displayName": "JDBC Driver Class",
       "defaultValue": "",
       "value": "",     // the value is overwritten in code
-      "isVisible": false,
+      "isVisible": true,
+      "isOverridable": false,
       "description": "Database name used for the Oozie",
-      "category": "Advanced",
-      "serviceName": "OOZIE"
+      "category": "Oozie Server",
+      "serviceName": "OOZIE",
+      "index": 6
     },
     {
       "id": "site property",
@@ -408,20 +410,22 @@ module.exports =
       "displayType": "advanced",
       "category": "Oozie Server",
       "serviceName": "OOZIE",
-      "index": 6
+      "index": 7
     },
 
   /**********************************************hive-site***************************************/
     {
       "id": "site property",
       "name": "javax.jdo.option.ConnectionDriverName",
-      "displayName": "JDBC driver class",
+      "displayName": "JDBC Driver Class",
       "defaultValue": "",
       "value": "",     // the value is overwritten in code
-      "isVisible": false,
+      "isVisible": true,
+      "isOverridable": false,
       "description": "Driver class name for a JDBC metastore",
-      "category": "Advanced",
-      "serviceName": "HIVE"
+      "category": "Hive Metastore",
+      "serviceName": "HIVE",
+      "index": 7
     },
     {
       "id": "site property",
@@ -460,7 +464,7 @@ module.exports =
       "isVisible": true,
       "category": "Hive Metastore",
       "serviceName": "HIVE",
-      "index": 7
+      "index": 8
     },
     {
       "id": "site property",

http://git-wip-us.apache.org/repos/asf/ambari/blob/60c16d77/ambari-web/app/views/wizard/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js
index b4333f5..e8eedc2 100644
--- a/ambari-web/app/views/wizard/controls_view.js
+++ b/ambari-web/app/views/wizard/controls_view.js
@@ -199,34 +199,40 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
     // The following if condition will be satisfied only for installer wizard flow
     if (this.get('configs').length) {
       var connectionUrl = this.get('connectionUrl');
+      var dbClass = this.get('dbClass');
       if (connectionUrl) {
         if (this.get('serviceConfig.serviceName') === 'HIVE') {
           switch (this.get('serviceConfig.value')) {
             case 'New MySQL Database':
             case 'Existing MySQL Database':
               connectionUrl.set('value', "jdbc:mysql://" + this.get('hostName') + "/" + this.get('databaseName')
+ "?createDatabaseIfNotExist=true");
+              dbClass.set('value', "com.mysql.jdbc.Driver");
               break;
             case 'Existing Oracle Database':
               connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') +
":1521/" + this.get('databaseName'));
+              dbClass.set('value', "oracle.jdbc.driver.OracleDriver");
               break;
           }
         } else if (this.get('serviceConfig.serviceName') === 'OOZIE') {
           switch (this.get('serviceConfig.value')) {
             case 'New Derby Database':
               connectionUrl.set('value', "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true");
+              dbClass.set('value', "org.apache.derby.jdbc.EmbeddedDriver");
               break;
             case 'Existing MySQL Database':
               connectionUrl.set('value', "jdbc:mysql://" + this.get('hostName') + "/" + this.get('databaseName'));
+              dbClass.set('value', "com.mysql.jdbc.Driver");
               break;
             case 'Existing Oracle Database':
               connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') +
":1521/" + this.get('databaseName'));
+              dbClass.set('value', "oracle.jdbc.driver.OracleDriver");
               break;
           }
         }
         connectionUrl.set('defaultValue', connectionUrl.get('value'));
       }
     }
-  }.observes('databaseName', 'hostName', 'connectionUrl'),
+  }.observes('databaseName', 'hostName', 'connectionUrl','dbClass'),
 
   nameBinding: 'serviceConfig.radioName',
 
@@ -293,6 +299,14 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
     }
   }.property('serviceConfig.serviceName'),
 
+  dbClass: function () {
+    if (this.get('serviceConfig.serviceName') === 'HIVE') {
+      return this.get('categoryConfigsAll').findProperty('name', 'javax.jdo.option.ConnectionDriverName');
+    } else {
+      return this.get('categoryConfigsAll').findProperty('name', 'oozie.service.JPAService.jdbc.driver');
+    }
+  }.property('serviceConfig.serviceName'),
+
   optionsBinding: 'serviceConfig.options'
 });
 


Mime
View raw message