Explorar o código

AMBARI-1059. Refactor cluster management. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418934 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako %!s(int64=12) %!d(string=hai) anos
pai
achega
b7255ac618

+ 25 - 20
ambari-web/app/controllers/wizard/step7_controller.js

@@ -42,15 +42,15 @@ App.WizardStep7Controller = Em.Controller.extend({
     return !this.stepConfigs.everyProperty('errorCount', 0);
   }.property('stepConfigs.@each.errorCount'),
 
-  selectedServiceNames : function(){
+  selectedServiceNames: function () {
     return this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName');
   }.property('content.services').cacheable(),
 
-  masterComponentHosts : function(){
+  masterComponentHosts: function () {
     return this.get('content.masterComponentHosts');
   }.property('content.masterComponentHosts'),
 
-  slaveComponentHosts : function(){
+  slaveComponentHosts: function () {
     return this.get('content.slaveComponentHosts');
   }.property('content.slaveComponentHosts'),
 
@@ -71,23 +71,28 @@ App.WizardStep7Controller = Em.Controller.extend({
     this.clearStep();
     var serviceConfigs = this.get('serviceConfigs');
     var advancedConfig = this.get('content.advancedServiceConfig');
-    advancedConfig.forEach(function(_config){
-      var service = serviceConfigs.findProperty('serviceName',_config.serviceName);
-      if(service) {
-        if(this.get('configMapping').someProperty('name',_config.name)) {
-        } else if(!(service.configs.someProperty('name',_config.name))) {
+    advancedConfig.forEach(function (_config) {
+      var service = serviceConfigs.findProperty('serviceName', _config.serviceName);
+      if (service) {
+        if (this.get('configMapping').someProperty('name', _config.name)) {
+        } else if (!(service.configs.someProperty('name', _config.name))) {
           _config.id = "site property";
           _config.category = 'Advanced';
           _config.displayName = _config.name;
           _config.defaultValue = _config.value;
-          _config.value = '',
+          if (/\${.*}/.test(_config.value)) {
+            console.log("Step7: The name that matched regex: " + _config.name);
+            _config.isRequired = false;
+            _config.value = '';
+          } else if(/^\s+$/.test(_config.value)){
+            _config.isRequired = false;
+          }
           _config.isVisible = true;
-          _config.isRequired = false;
           _config.displayType = 'advanced';
           service.configs.pushObject(_config);
         }
       }
-    },this);
+    }, this);
     this.loadCustomConfig();
     this.renderServiceConfigs(serviceConfigs);
     var storedServices = this.get('content.serviceConfigProperties');
@@ -101,7 +106,7 @@ App.WizardStep7Controller = Em.Controller.extend({
 
           var componentVal = storedServices.findProperty('name', _config.get('name'));
           //if we have config for specified component
-          if(componentVal){
+          if (componentVal) {
             //set it
             _config.set('value', componentVal.value)
           }
@@ -112,16 +117,16 @@ App.WizardStep7Controller = Em.Controller.extend({
     }
   },
 
-  loadCustomConfig: function() {
+  loadCustomConfig: function () {
     var serviceConfigs = this.get('serviceConfigs');
-    this.get('customConfigs').forEach(function(_config){
-      var service = serviceConfigs.findProperty('serviceName',_config.serviceName);
-        if(service) {
-          if(!(service.configs.someProperty('name',_config.name))) {
-            service.configs.pushObject(_config);
-          }
+    this.get('customConfigs').forEach(function (_config) {
+      var service = serviceConfigs.findProperty('serviceName', _config.serviceName);
+      if (service) {
+        if (!(service.configs.someProperty('name', _config.name))) {
+          service.configs.pushObject(_config);
         }
-    },this);
+      }
+    }, this);
   },
 
   /**

+ 0 - 2
ambari-web/app/controllers/wizard/step8_controller.js

@@ -913,7 +913,6 @@ App.WizardStep8Controller = Em.Controller.extend({
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
-
     return {type: 'mapred-site', tag: 'version1', properties: mrProperties};
   },
 
@@ -969,7 +968,6 @@ App.WizardStep8Controller = Em.Controller.extend({
         console.log("TRACE: STep8 -> In success function for the applyCreatedConfToService call");
         console.log("TRACE: STep8 -> value of the url is: " + url);
         console.log("TRACE: STep8 -> value of the received data is: " + jsonData);
-
       },
 
       error: function (request, ajaxOptions, error) {

+ 20 - 1
ambari-web/app/data/config_mapping.js

@@ -296,6 +296,25 @@ module.exports = [
     "value": "http://<templateName[0]>:11000/oozie",
     "filename": "oozie-site.xml"
   },
+  //TODO: Oozie configs hardcoded for now. Map them to templates later
+  {
+    "name": "oozie.service.JPAService.jdbc.password",
+    "templateName": [],
+    "value": " ",
+    "filename": "oozie-site.xml"
+  },
+  {
+    "name": "oozie.db.schema.name",
+    "templateName": [],
+    "value": "oozie",
+    "filename": "oozie-site.xml"
+  },
+  {
+    "name": "oozie.service.JPAService.jdbc.url",
+    "templateName": [],
+    "value": "jdbc:derby:/var/data/oozie/oozie-db;create=true",
+    "filename": "oozie-site.xml"
+  },
   {
     "name": "javax.jdo.option.ConnectionURL",
     "templateName": ["hive_mysql_host", "hive_database_name"],
@@ -405,7 +424,7 @@ module.exports = [
     "name": "mapred.child.java.opts",
     "templateName": ["mapred_child_java_opts_sz"],
     "foreignKey": null,
-    "value": "<templateName[0]>",
+    "value": "-server -Xmx<templateName[0]>m -Djava.net.preferIPv4Stack=true",
     "filename": "mapred-site.xml"
   },
   {