ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject git commit: AMBARI-6747 Changing CapScheduler only versions all configs in service. (Buzhor Denys via ababiichuk)
Date Tue, 05 Aug 2014 16:59:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9f2b109e4 -> d70da2c85


AMBARI-6747 Changing CapScheduler only versions all configs in service. (Buzhor Denys via
ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d70da2c8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d70da2c8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d70da2c8

Branch: refs/heads/trunk
Commit: d70da2c852521ff552a3baafc298fed9dcb97985
Parents: 9f2b109
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Tue Aug 5 19:58:02 2014 +0300
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Tue Aug 5 19:58:02 2014 +0300

----------------------------------------------------------------------
 .../app/controllers/main/service/info/configs.js     | 15 ++++++++++++++-
 ambari-web/app/utils/config.js                       |  8 ++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d70da2c8/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 2270fdf..b24345d 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1031,7 +1031,20 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
       if (this.get('content.serviceName') === 'YARN' && !App.supports.capacitySchedulerUi)
{
         configs = App.config.textareaIntoFileConfigs(configs, 'capacity-scheduler.xml');
       }
-      this.saveSiteConfigs(configs.filterProperty('group', null));
+      var modifiedConfigs = configs
+        // get only modified and created configs
+        .filter(function(config) { return config.get('isNotDefaultValue') || config.get('isNotSaved');
})
+        // get file names
+        .mapProperty('filename').uniq()
+        // get configs by filename
+        .map(function(fileName) {
+          return configs.filterProperty('filename', fileName);
+        })
+        // concatenate results
+        .reduce(function(current, prev) { return current.concat(prev); });
+
+      // save modified original configs that have no group
+      this.saveSiteConfigs(modifiedConfigs.filter(function(config) { return !config.get('group');
}));
 
       /**
        * First we put cluster configurations, which automatically creates /configurations

http://git-wip-us.apache.org/repos/asf/ambari/blob/d70da2c8/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index b017ebc..ba57aae 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -334,6 +334,7 @@ App.config = Em.Object.create({
           isOverridable: true,
           isRequired: true,
           isFinal: finalAttributes[index] === "true",
+          defaultIsFinal: finalAttributes[index] === "true",
           showLabel: true,
           serviceName: serviceName,
           belongsToService: []
@@ -840,6 +841,7 @@ App.config = Em.Object.create({
             description: item.property_description,
             isVisible: item.isVisible,
             isFinal: item.final === "true",
+            defaultIsFinal: item.final === "true",
             filename: item.filename || fileName
           });
         }
@@ -1113,6 +1115,7 @@ App.config = Em.Object.create({
       "isOverridable": true,
       "isRequired": true,
       "isVisible": true,
+      "supportsFinal": true,
       "serviceName": "YARN",
       "filename": "capacity-scheduler.xml",
       "category": "CapacityScheduler"
@@ -1137,8 +1140,11 @@ App.config = Em.Object.create({
         value += _config.name + '=' + _config.value + '\n';
         defaultValue += _config.name + '=' + _config.defaultValue + '\n';
       }, this);
+      var isFinal = fileConfigs.someProperty('isFinal', true);
       complexConfig.value = value;
       complexConfig.defaultValue = defaultValue;
+      complexConfig.isFinal = isFinal;
+      complexConfig.defaultIsFinal = isFinal;
       configs = configs.filter(function (_config) {
         return _config.filename !== filename;
       });
@@ -1173,6 +1179,8 @@ App.config = Em.Object.create({
             defaultValue: value,
             serviceName: configsTextarea.get('serviceName'),
             filename: filename,
+            isFinal: configsTextarea.get('isFinal'),
+            isNotDefaultValue: configsTextarea.get('isNotDefaultValue'),
             group: null
           }));
         }


Mime
View raw message