ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARI-9462. Adding Hive Metastore changes core-site prop to final
Date Tue, 03 Feb 2015 21:37:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d128a0dc6 -> fcdbadd59


AMBARI-9462. Adding Hive Metastore changes core-site prop to final


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

Branch: refs/heads/trunk
Commit: fcdbadd59be9fdb2defed94567560b33f4b43905
Parents: d128a0d
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Tue Feb 3 11:42:55 2015 -0800
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Tue Feb 3 13:31:27 2015 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js | 55 ++++++++++++++++----
 .../test/controllers/main/host/details_test.js  |  2 +-
 2 files changed, 45 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fcdbadd5/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index bd221c4..0231f56 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -635,12 +635,14 @@ App.MainHostDetailsController = Em.Controller.extend({
     var hiveMSHosts = this.getHiveHosts();
     var hiveMasterHosts = hiveMSHosts.concat(App.HostComponent.find().filterProperty('componentName',
'HIVE_SERVER').mapProperty('hostName')).uniq().sort().join(',');
     var configs = {};
+    var attributes = {};
     var port = "";
     var hiveUser = "";
     var webhcatUser = "";
 
     data.items.forEach(function (item) {
       configs[item.type] = item.properties;
+      attributes[item.type] = item.properties_attributes || {};
     }, this);
 
     port = configs['hive-site']['hive.metastore.uris'].match(/:[0-9]{2,4}/);
@@ -658,11 +660,25 @@ App.MainHostDetailsController = Em.Controller.extend({
     configs['core-site']['hadoop.proxyuser.' + webhcatUser + '.hosts'] = hiveMasterHosts;
     var groups = [
       {
-        'hive-site': configs['hive-site'],
-        'webhcat-site': configs['webhcat-site'],
-        'hive-env': configs['hive-env']
+        properties: {
+          'hive-site': configs['hive-site'],
+          'webhcat-site': configs['webhcat-site'],
+          'hive-env': configs['hive-env']
+        },
+        properties_attributes: {
+          'hive-site': attributes['hive-site'],
+          'webhcat-site': attributes['webhcat-site'],
+          'hive-env': attributes['hive-env']
+        }
       },
-      {'core-site': configs['core-site']}
+      {
+        properties: {
+          'core-site': configs['core-site']
+        },
+        properties_attributes: {
+          'core-site': attributes['core-site']
+        }
+      }
     ];
     this.saveConfigsBatch(groups);
   },
@@ -672,15 +688,17 @@ App.MainHostDetailsController = Em.Controller.extend({
    * @param groups
    */
   saveConfigsBatch: function (groups) {
-    groups.forEach(function (configs) {
+    groups.forEach(function (group) {
       var desiredConfigs = [];
       var tag = 'version' + (new Date).getTime();
-      for (var site in configs) {
-        if (!configs.hasOwnProperty(site)) continue;
+      var properties = group.properties;
+      for (var site in properties) {
+        if (!properties.hasOwnProperty(site)) continue;
         desiredConfigs.push({
           "type": site,
           "tag": tag,
-          "properties": configs[site],
+          "properties": properties[site],
+          "properties_attributes": group.properties_attributes[site],
           "service_config_version_note": Em.I18n.t('hosts.host.hive.configs.save.note')
         });
       }
@@ -852,8 +870,10 @@ App.MainHostDetailsController = Em.Controller.extend({
    */
   saveZkConfigs: function (data) {
     var configs = {};
+    var attributes = {};
     data.items.forEach(function (item) {
       configs[item.type] = item.properties;
+      attributes[item.type] = item.properties_attributes || {};
     }, this);
 
     var zks = this.getZkServerHosts();
@@ -863,10 +883,23 @@ App.MainHostDetailsController = Em.Controller.extend({
     this.setZKConfigs(configs, zksWithPort, zks);
     var groups = [
       {
-        'hive-site': configs['hive-site'],
-        'webhcat-site': configs['webhcat-site']
+        properties: {
+          'hive-site': configs['hive-site'],
+          'webhcat-site': configs['webhcat-site']
+        },
+        properties_attributes: {
+          'hive-site': attributes['hive-site'],
+          'webhcat-site': attributes['webhcat-site']
+        }
       },
-      {'yarn-site': configs['yarn-site']}
+      {
+        properties: {
+          'yarn-site': configs['yarn-site']
+        },
+        properties_attributes: {
+          'yarn-site': attributes['yarn-site']
+        }
+      }
     ];
     this.saveConfigsBatch(groups);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/fcdbadd5/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 0b2f572..1afbbf4 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -744,7 +744,7 @@ describe('App.MainHostDetailsController', function () {
       expect(App.ajax.send.called).to.be.false;
     });
     it("configs is correct", function() {
-      controller.saveConfigsBatch([{'site': {}}]);
+      controller.saveConfigsBatch([{'properties' : {'site': {}}, 'properties_attributes':
{'site': {}}}]);
       expect(App.ajax.send.calledOnce).to.be.true;
     });
   });


Mime
View raw message