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://<templateName[0]>\/<templateName[1]>?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')
});