Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08DC610E98 for ; Mon, 4 Nov 2013 21:23:02 +0000 (UTC) Received: (qmail 30673 invoked by uid 500); 4 Nov 2013 21:23:02 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 30644 invoked by uid 500); 4 Nov 2013 21:23:01 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 30637 invoked by uid 99); 4 Nov 2013 21:23:01 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Nov 2013 21:23:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A6D183D2C4; Mon, 4 Nov 2013 21:23:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaimin@apache.org To: ambari-commits@incubator.apache.org Message-Id: <3a2775599b8d4c61bf13c9f19063605f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-3682: Invalid UI behaviour after editing Hive/Oozie database URL. (jaimin) Date: Mon, 4 Nov 2013 21:23:01 +0000 (UTC) Updated Branches: refs/heads/trunk 8a995902a -> fefb83c33 AMBARI-3682: Invalid UI behaviour after editing Hive/Oozie database URL. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/fefb83c3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/fefb83c3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/fefb83c3 Branch: refs/heads/trunk Commit: fefb83c33b279a70274c22fb515cec84db9f9060 Parents: 8a99590 Author: Jaimin Jetly Authored: Mon Nov 4 13:13:45 2013 -0800 Committer: Jaimin Jetly Committed: Mon Nov 4 13:21:31 2013 -0800 ---------------------------------------------------------------------- .../controllers/main/service/info/configs.js | 73 -------------------- ambari-web/app/data/HDP2/global_properties.js | 1 - ambari-web/app/data/global_properties.js | 15 ---- ambari-web/app/views/wizard/controls_view.js | 51 +++++++------- 4 files changed, 27 insertions(+), 113 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fefb83c3/ambari-web/app/controllers/main/service/info/configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js index f139a8d..67a5758 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -1343,11 +1343,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({ createSiteObj: function (siteName, tagName) { var siteObj = this.get('uiConfigs').filterProperty('filename', siteName + '.xml'); var siteProperties = {}; - if (siteName == 'oozie-site') { - siteObj = this.getOozieSiteObj(siteObj); - } else if (siteName == 'hive-site') { - siteObj = this.getHiveSiteObj(siteObj); - } siteObj.forEach(function (_siteObj) { siteProperties[_siteObj.name] = App.config.escapeXMLCharacters(_siteObj.value); this.recordHostOverride(_siteObj, siteName, tagName, this); @@ -1356,74 +1351,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({ }, /** - * create site object for Oozie - * @param siteObj - * @return {Object} - */ - getOozieSiteObj: function (siteObj) { - var jdbcUrl = siteObj.findProperty('name', 'oozie.service.JPAService.jdbc.url'); - var jdbcDriver = siteObj.findProperty('name', 'oozie.service.JPAService.jdbc.driver'); - var oozieDbName = siteObj.findProperty('name', 'oozie.db.schema.name'); - var oozieDb = this.get('globalConfigs').findProperty('name', 'oozie_database').value; - // oozieHost is undefined if the database is derby - var oozieHost = (oozieDb == 'New Derby Database') ? '' : this.get('globalConfigs').findProperty('name', 'oozie_hostname').value; - var defaultJdbcUrl; - - switch (oozieDb) { - case 'New Derby Database': - defaultJdbcUrl = "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true"; - jdbcDriver.set('value','org.apache.derby.jdbc.EmbeddedDriver'); - break; - case 'Existing MySQL Database': - defaultJdbcUrl = "jdbc:mysql://" + oozieHost + "/" + oozieDbName; - jdbcDriver.set('value','com.mysql.jdbc.Driver'); - break; - case 'Existing Oracle Database': - defaultJdbcUrl = "jdbc:oracle:thin:@//" + oozieHost + ":1521/" + oozieDbName; - jdbcDriver.set('value','oracle.jdbc.driver.OracleDriver'); - break; - } - // in case the user upgraded from Ambari version <= 1.2.3, they will not have oozie_jdbc_connection_url global - var jdbcUrlInGlobal = this.get('globalConfigs').findProperty('name', 'oozie_jdbc_connection_url'); - jdbcUrl.set('value', jdbcUrlInGlobal ? jdbcUrlInGlobal.value : defaultJdbcUrl); - return siteObj; - }, - - /** - * create site object for Hive - * @param siteObj - * @return {Object} - */ - getHiveSiteObj: function (siteObj) { - var jdbcUrl = siteObj.findProperty('name', 'javax.jdo.option.ConnectionURL'); - var jdbcDriver = siteObj.findProperty('name', 'javax.jdo.option.ConnectionDriverName'); - - var hiveDb = this.get('globalConfigs').findProperty('name', 'hive_database').value; - var hiveHost = this.get('globalConfigs').findProperty('name', 'hive_hostname').value; - var hiveDbName = this.get('globalConfigs').findProperty('name', 'hive_database_name').value; - var defaultJdbcUrl; - - switch (hiveDb) { - case 'New MySQL Database': - defaultJdbcUrl = "jdbc:mysql://" + hiveHost + "/" + hiveDbName + "?createDatabaseIfNotExist=true"; - jdbcDriver.set('value', 'com.mysql.jdbc.Driver'); - break; - case 'Existing MySQL Database': - defaultJdbcUrl = "jdbc:mysql://" + hiveHost + "/" + hiveDbName + "?createDatabaseIfNotExist=true"; - jdbcDriver.set('value', 'com.mysql.jdbc.Driver'); - break; - case 'Existing Oracle Database': - defaultJdbcUrl = "jdbc:oracle:thin:@//" + hiveHost + ":1521/" + hiveDbName; - jdbcDriver.set('value','oracle.jdbc.driver.OracleDriver'); - break; - } - // in case the user upgraded from Ambari <= 1.2.3, they will not have hive_jdbc_connection_url global - var jdbcUrlInGlobal = this.get('globalConfigs').findProperty('name', 'hive_jdbc_connection_url'); - jdbcUrl.set('value', jdbcUrlInGlobal ? jdbcUrlInGlobal.value : defaultJdbcUrl); - return siteObj; - }, - - /** * Set display names of the property from the puppet/global names * @param: displayNames: a field to be set with displayNames * @param names: array of property puppet/global names http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fefb83c3/ambari-web/app/data/HDP2/global_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/global_properties.js b/ambari-web/app/data/HDP2/global_properties.js index e96ccfc..afe4c0f 100644 --- a/ambari-web/app/data/HDP2/global_properties.js +++ b/ambari-web/app/data/HDP2/global_properties.js @@ -557,7 +557,6 @@ module.exports = "displayType": "masterHost", "isOverridable": false, "isVisible": true, - "isObserved": true, "serviceName": "HIVE", "category": "Hive Metastore", "index": 0 http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fefb83c3/ambari-web/app/data/global_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/global_properties.js b/ambari-web/app/data/global_properties.js index 778af30..0535026 100644 --- a/ambari-web/app/data/global_properties.js +++ b/ambari-web/app/data/global_properties.js @@ -656,7 +656,6 @@ module.exports = "displayType": "masterHost", "isOverridable": false, "isVisible": true, - "isObserved": true, "serviceName": "HIVE", "category": "Hive Metastore", "index": 0 @@ -825,20 +824,6 @@ module.exports = }, { "id": "puppet var", - "name": "hive_jdbc_connection_url", - "displayName": "Database URL", - "value": "", - "defaultValue": "jdbc", // set to a 'jdbc' to not include this in initial error count - "description": "The JDBC connection URL to the database", - "displayType": "advanced", - "isOverridable": false, - "isVisible": true, - "serviceName": "HIVE", - "category": "Hive Metastore", - "index": 7 - }, - { - "id": "puppet var", "name": "hive_metastore_port", "displayName": "Hive metastore port", "description": "", http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fefb83c3/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 41fc3c6..cabfa4f 100644 --- a/ambari-web/app/views/wizard/controls_view.js +++ b/ambari-web/app/views/wizard/controls_view.js @@ -214,32 +214,35 @@ App.ServiceConfigRadioButtons = Ember.View.extend({ categoryConfigsAll: null, onOptionsChange: function () { - var connectionUrl = this.get('connectionUrl'); - 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"); - break; - case 'Existing Oracle Database': - connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName')); - 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"); - break; - case 'Existing MySQL Database': - connectionUrl.set('value', "jdbc:mysql://" + this.get('hostName') + "/" + this.get('databaseName')); - break; - case 'Existing Oracle Database': - connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName')); - break; + // The following if condition will be satisfied only for installer wizard flow + if (this.get('configs').length) { + var connectionUrl = this.get('connectionUrl'); + 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"); + break; + case 'Existing Oracle Database': + connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName')); + 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"); + break; + case 'Existing MySQL Database': + connectionUrl.set('value', "jdbc:mysql://" + this.get('hostName') + "/" + this.get('databaseName')); + break; + case 'Existing Oracle Database': + connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName')); + break; + } } + connectionUrl.set('defaultValue', connectionUrl.get('value')); } - connectionUrl.set('defaultValue', connectionUrl.get('value')); } }.observes('databaseName', 'hostName', 'connectionUrl'),