浏览代码

AMBARI-1837. Few core-site properties vanished after seemingly benign reconfiguration. (jaimin)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1465766 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly 12 年之前
父节点
当前提交
c78b4dae4c
共有 3 个文件被更改,包括 7 次插入71 次删除
  1. 3 0
      CHANGES.txt
  2. 2 69
      ambari-web/app/controllers/main/service/info/configs.js
  3. 2 2
      ambari-web/app/utils/config.js

+ 3 - 0
CHANGES.txt

@@ -656,6 +656,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1837. Few core-site properties vanished after seemingly benign 
+reconfiguration. (jaimin)
+
  AMBARI-1838. Cluster Management > Services > MapReduce > Config throws JS error
  and the page comes up blank. (jaimin)
 

+ 2 - 69
ambari-web/app/controllers/main/service/info/configs.js

@@ -806,9 +806,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
       if(typeof _config.get('value') === "boolean") _config.set('value', _config.value.toString());
     });
     var storedConfigs = serviceConfigProperties.filterProperty('value');
-    var preConfigs = this.loadUiSideConfigs(this.get('configMapping').overridable());
-    var postConfigs = this.loadUiSideConfigs(this.get('configMapping').computed());
-    this.set('uiConfigs', preConfigs.concat(storedConfigs).concat(postConfigs));
+    var allUiConfigs = this.loadUiSideConfigs(this.get('configMapping').all());
+    this.set('uiConfigs', storedConfigs.concat(allUiConfigs));
   },
 
   /**
@@ -830,16 +829,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         });
       }
     }, this);
-    var dependentConfig = configMapping.filterProperty('foreignKey');
-    dependentConfig.forEach(function (_config) {
-      this.setConfigValue(uiConfig, _config);
-      uiConfig.pushObject({
-        "id": "site property",
-        "name": _config._name || _config.name,
-        "value": _config.value,
-        "filename": _config.filename
-      });
-    }, this);
     return uiConfig;
   },
 
@@ -896,62 +885,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     }, this);
     return value;
   },
-  /**
-   * Set all site property that are derived from other site-properties
-   */
-  setConfigValue: function (uiConfig, config) {
-    if (config.value == null) {
-      return;
-    }
-    var fkValue = config.value.match(/<(foreignKey.*?)>/g);
-    if (fkValue) {
-      fkValue.forEach(function (_fkValue) {
-        var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
-        if (uiConfig.someProperty('name', config.foreignKey[index])) {
-          var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
-          config.value = config.value.replace(_fkValue, globalValue);
-        } else if (this.get('globalConfigs').someProperty('name', config.foreignKey[index])) {
-          var globalValue;
-          if (this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value === '') {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).defaultValue;
-          } else {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value;
-          }
-          config.value = config.value.replace(_fkValue, globalValue);
-        }
-      }, this);
-    }
-    if (fkValue = config.name.match(/<(foreignKey.*?)>/g)) {
-      fkValue.forEach(function (_fkValue) {
-        var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
-        if (uiConfig.someProperty('name', config.foreignKey[index])) {
-          var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
-          config._name = config.name.replace(_fkValue, globalValue);
-        } else if (this.get('globalConfigs').someProperty('name', config.foreignKey[index])) {
-          var globalValue;
-          if (this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value === '') {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).defaultValue;
-          } else {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value;
-          }
-          config._name = config.name.replace(_fkValue, globalValue);
-        }
-      }, this);
-    }
-    //For properties in the configMapping file having foreignKey and templateName properties.
-    var templateValue = config.value.match(/<(templateName.*?)>/g);
-    if (templateValue) {
-      templateValue.forEach(function (_value) {
-        var index = parseInt(_value.match(/\[([\d]*)(?=\])/)[1]);
-        if (this.get('globalConfigs').someProperty('name', config.templateName[index])) {
-          var globalValue = this.get('globalConfigs').findProperty('name', config.templateName[index]).value;
-          config.value = config.value.replace(_value, globalValue);
-        } else {
-          config.value = null;
-        }
-      }, this);
-    }
-  },
 
   /**
    * Saves cluster level configurations for all necessary sites.

+ 2 - 2
ambari-web/app/utils/config.js

@@ -88,7 +88,7 @@ App.config = Em.Object.create({
           defaultValue: properties[index],
           filename: _tag.siteName + ".xml",
           isUserProperty: false,
-          isOverrideable: true
+          isOverridable: true
         };
 
         if (configsPropertyDef) {
@@ -98,7 +98,7 @@ App.config = Em.Object.create({
           serviceConfigObj.isVisible = (configsPropertyDef.isVisible !== undefined) ? configsPropertyDef.isVisible : true;
           serviceConfigObj.unit = (configsPropertyDef.unit !== undefined) ? configsPropertyDef.unit : undefined;
           serviceConfigObj.description = (configsPropertyDef.description !== undefined) ? configsPropertyDef.description : undefined;
-          serviceConfigObj.isOverrideable = configsPropertyDef.isOverridable === undefined ? true : configsPropertyDef.isOverridable;
+          serviceConfigObj.isOverridable = configsPropertyDef.isOverridable === undefined ? true : configsPropertyDef.isOverridable;
         }
         if (_tag.siteName === 'global') {
           if (configsPropertyDef) {