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 7C1E3E319 for ; Fri, 11 Jan 2013 01:46:30 +0000 (UTC) Received: (qmail 9780 invoked by uid 500); 11 Jan 2013 01:46:30 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 9755 invoked by uid 500); 11 Jan 2013 01:46:30 -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 9748 invoked by uid 99); 11 Jan 2013 01:46:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 01:46:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 01:46:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CD04123888FE; Fri, 11 Jan 2013 01:46:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1431791 - in /incubator/ambari/trunk/ambari-web/app: controllers/main/service/info/configs.js data/config_mapping.js data/config_properties.js views/wizard/controls_view.js Date: Fri, 11 Jan 2013 01:46:06 -0000 To: ambari-commits@incubator.apache.org From: yusaku@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130111014606.CD04123888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: yusaku Date: Fri Jan 11 01:46:06 2013 New Revision: 1431791 URL: http://svn.apache.org/viewvc?rev=1431791&view=rev Log: AMBARI-1145. Cluster Management refactoring. (yusaku) Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js incubator/ambari/trunk/ambari-web/app/data/config_mapping.js incubator/ambari/trunk/ambari-web/app/data/config_properties.js incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js?rev=1431791&r1=1431790&r2=1431791&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js (original) +++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js Fri Jan 11 01:46:06 2013 @@ -306,6 +306,7 @@ App.MainServiceInfoConfigsController = E serviceConfigObj.serviceName = this.get('configs').someProperty('name', index) ? this.get('configs').findProperty('name', index).serviceName : null; serviceConfigObj.displayName = this.get('configs').someProperty('name', index) ? this.get('configs').findProperty('name', index).displayName : null; serviceConfigObj.category = this.get('configs').someProperty('name', index) ? this.get('configs').findProperty('name', index).category : null; + serviceConfigObj.options = this.get('configs').someProperty('name', index) ? this.get('configs').findProperty('name', index).options : null; globalConfigs.pushObject(serviceConfigObj); } else if (!this.get('configMapping').someProperty('name', index)) { if (advancedConfig.someProperty('name', index)) { @@ -548,9 +549,29 @@ App.MainServiceInfoConfigsController = E }); } }, this); + + this.setHiveHostName(globalConfigs); this.set('globalConfigs', globalConfigs); }, + setHiveHostName: function(globals) { + if (globals.someProperty('name', 'hive_database')) { + //TODO: Hive host depends on the type of db selected. Change puppet variable name if postgres is not the default db + var hiveDb = globals.findProperty('name', 'hive_database'); + if (hiveDb.value === 'New MySQL Database') { + if (globals.someProperty('name', 'hive_ambari_host')) { + globals.findProperty('name', 'hive_ambari_host').name = 'hive_mysql_hostname'; + } + globals = globals.without(globals.findProperty('name', 'hive_existing_host')); + globals = globals.without(globals.findProperty('name', 'hive_existing_database')); + } else { + globals.findProperty('name', 'hive_existing_host').name = 'hive_mysql_hostname'; + globals = globals.without(globals.findProperty('name', 'hive_ambari_host')); + globals = globals.without(globals.findProperty('name', 'hive_ambari_database')); + } + } + }, + saveSiteConfigs: function (configs) { var storedConfigs = configs.filterProperty('id', 'site property').filterProperty('value'); var uiConfigs = this.loadUiSideConfigs(); @@ -923,9 +944,6 @@ App.MainServiceInfoConfigsController = E var hiveMetastoreHost = serviceConfigs.findProperty('name', 'hivemetastore_host'); hiveMetastoreHost.defaultValue = this.get('content.components').findProperty('componentName', 'HIVE_SERVER').get('host.hostName'); globalConfigs.push(hiveMetastoreHost); - var hiveDbHost = serviceConfigs.findProperty('name', 'hive_mysql_hostname'); - hiveDbHost.defaultValue = this.get('content.components').findProperty('componentName', 'HIVE_SERVER').get('host.hostName'); - globalConfigs.push(hiveDbHost); break; case 'OOZIE': var oozieServerHost = serviceConfigs.findProperty('name', 'oozieserver_host'); Modified: incubator/ambari/trunk/ambari-web/app/data/config_mapping.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/config_mapping.js?rev=1431791&r1=1431790&r2=1431791&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/data/config_mapping.js (original) +++ incubator/ambari/trunk/ambari-web/app/data/config_mapping.js Fri Jan 11 01:46:06 2013 @@ -333,7 +333,7 @@ module.exports = [ */ { "name": "javax.jdo.option.ConnectionURL", - "templateName": ["hive_mysql_host", "hive_database_name"], + "templateName": ["hive_mysql_hostname", "hive_database_name"], "foreignKey": null, "value": "jdbc:mysql://\/?createDatabaseIfNotExist=true", "filename": "hive-site.xml" Modified: incubator/ambari/trunk/ambari-web/app/data/config_properties.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/config_properties.js?rev=1431791&r1=1431790&r2=1431791&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/data/config_properties.js (original) +++ incubator/ambari/trunk/ambari-web/app/data/config_properties.js Fri Jan 11 01:46:06 2013 @@ -867,6 +867,7 @@ module.exports = ], "description": "MySQL will be installed by Ambari", "displayType": "radio button", + "isReconfigurable": false, "radioName": "hive-database", "isVisible": true, "domain": "global", @@ -882,6 +883,7 @@ module.exports = "description": "Using an existing database for Hive Metastore", "displayType": "masterHost", "isVisible": false, + "isReconfigurable": false, "domain": "global", "serviceName": "HIVE", "category": "Hive Metastore" Modified: incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js?rev=1431791&r1=1431790&r2=1431791&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js Fri Jan 11 01:46:06 2013 @@ -161,7 +161,10 @@ App.ServiceConfigRadioButtons = Ember.Vi serviceConfig: null, categoryConfigs: null, nameBinding: 'serviceConfig.radioName', - optionsBinding: 'serviceConfig.options' + optionsBinding: 'serviceConfig.options', + disabled: function () { + return !this.get('serviceConfig.isEditable'); + }.property('serviceConfig.isEditable') }); App.ServiceConfigRadioButton = Ember.Checkbox.extend({ @@ -196,13 +199,19 @@ App.ServiceConfigRadioButton = Ember.Che } }, this); }, this); - }.observes('checked') + }.observes('checked'), + disabled: function () { + return !this.get('serviceConfig.isEditable'); + }.property('serviceConfig.isEditable') }); App.ServiceConfigComboBox = Ember.Select.extend(App.ServiceConfigPopoverSupport, { contentBinding: 'serviceConfig.options', selectionBinding: 'serviceConfig.value', - classNames: [ 'span3' ] + classNames: [ 'span3' ], + disabled: function () { + return !this.get('serviceConfig.isEditable'); + }.property('serviceConfig.isEditable') });