ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-13473 Navigation between pages in installer too long. (atkach)
Date Mon, 19 Oct 2015 14:33:41 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d23917f81 -> 67da040af


AMBARI-13473 Navigation between pages in installer too long. (atkach)


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

Branch: refs/heads/trunk
Commit: 67da040afbb3af86c3fec72b776f2816b3843697
Parents: d23917f
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Mon Oct 19 17:33:27 2015 +0300
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Mon Oct 19 17:33:27 2015 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step7_controller.js     | 17 +++++++++++++++--
 ambari-web/app/mappers/configs/themes_mapper.js    |  2 ++
 .../app/utils/configs/config_property_helper.js    |  9 +--------
 .../utils/configs/config_property_helper_test.js   |  8 ++++----
 4 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/67da040a/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 8bb37f7..4e6ab19 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -800,12 +800,25 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin,
App.E
     });
     services.forEach(function (service) {
       var configsByService = [];
-      var serviceConfigs = configs.filterProperty('serviceName', service.get('serviceName'));
+      var dependencies = {};
+      var serviceConfigs = [];
+
+      configs.forEach(function (config) {
+        if (config.serviceName === service.get('serviceName')) {
+          serviceConfigs.push(config);
+        }
+        if (config.filename === 'hive-site.xml' && config.name === 'hive.metastore.uris')
{
+          dependencies['hive.metastore.uris'] = config.recommendedValue;
+        }
+        if (config.filename === 'zoo.cfg.xml' && config.name === 'clientPort') {
+          dependencies['clientPort'] = config.recommendedValue;
+        }
+      }, this);
       serviceConfigs.forEach(function (_config) {
         var serviceConfigProperty = App.ServiceConfigProperty.create(_config);
         this.updateHostOverrides(serviceConfigProperty, _config);
         if (!storedConfigs && !serviceConfigProperty.get('hasInitialValue')) {
-          configPropertyHelper.initialValue(serviceConfigProperty, localDB, configs);
+          configPropertyHelper.initialValue(serviceConfigProperty, localDB, dependencies);
         }
         serviceConfigProperty.validate();
         configsByService.pushObject(serviceConfigProperty);

http://git-wip-us.apache.org/repos/asf/ambari/blob/67da040a/ambari-web/app/mappers/configs/themes_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/themes_mapper.js b/ambari-web/app/mappers/configs/themes_mapper.js
index 2fc9641..fff2013 100644
--- a/ambari-web/app/mappers/configs/themes_mapper.js
+++ b/ambari-web/app/mappers/configs/themes_mapper.js
@@ -71,6 +71,7 @@ App.themesMapper = App.QuickDataMapper.create({
   },
 
   map: function (json) {
+    console.time('App.themesMapper execution time');
     var tabs = [];
     json.items.forEach(function(item) {
       this.mapThemeLayouts(item, tabs);
@@ -80,6 +81,7 @@ App.themesMapper = App.QuickDataMapper.create({
 
     App.store.loadMany(this.get("tabModel"), tabs);
     App.store.commit();
+    console.timeEnd('App.themesMapper execution time');
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/67da040a/ambari-web/app/utils/configs/config_property_helper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/config_property_helper.js b/ambari-web/app/utils/configs/config_property_helper.js
index 125c1f8..3cafc9f 100644
--- a/ambari-web/app/utils/configs/config_property_helper.js
+++ b/ambari-web/app/utils/configs/config_property_helper.js
@@ -20,14 +20,7 @@ var App = require('app');
 
 module.exports = {
 
-  initialValue: function (configProperty, localDB, configs) {
-    var hiveMetastoreUrisConfig = configs.filterProperty('filename', 'hive-site.xml').findProperty('name',
'hive.metastore.uris');
-    var clientPortConfig = configs.filterProperty('filename', 'zoo.cfg.xml').findProperty('name',
'clientPort');
-    var dependencies = {
-      'hive.metastore.uris': hiveMetastoreUrisConfig && hiveMetastoreUrisConfig.recommendedValue,
-      'clientPort': clientPortConfig && clientPortConfig.recommendedValue
-    };
-
+  initialValue: function (configProperty, localDB, dependencies) {
     var masterComponentHostsInDB = localDB.masterComponentHosts;
     var isOnlyFirstOneNeeded = true;
     var hostWithPort = "([\\w|\\.]*)(?=:)";

http://git-wip-us.apache.org/repos/asf/ambari/blob/67da040a/ambari-web/test/utils/configs/config_property_helper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/configs/config_property_helper_test.js b/ambari-web/test/utils/configs/config_property_helper_test.js
index 70fb4da..853a830 100644
--- a/ambari-web/test/utils/configs/config_property_helper_test.js
+++ b/ambari-web/test/utils/configs/config_property_helper_test.js
@@ -280,7 +280,7 @@ describe('configPropertyHelper', function () {
         dependencies: {
           'hive.metastore.uris': 'thrift://localhost:9083'
         },
-        recommendedValue: 'hive.metastore.local=false,hive.metastore.uris=thrift://localhost:9933,hive.metastore.sasl.enabled=false',
+        recommendedValue: 'hive.metastore.local=false,hive.metastore.uris=thrift://localhost:9083,hive.metastore.sasl.enabled=false',
         value: 'hive.metastore.local=false,hive.metastore.uris=thrift://h0:9083\\,thrift://h1:9083,hive.metastore.sasl.enabled=false,hive.metastore.execute.setugi=true',
         title: 'should add relevant hive.metastore.uris value'
       },
@@ -402,7 +402,7 @@ describe('configPropertyHelper', function () {
         name: 'hive.metastore.uris',
         recommendedValue: cases['hive.metastore.uris'].recommendedValue
       });
-      configPropertyHelper.initialValue(serviceConfigProperty, cases['hive.metastore.uris'].localDB,
[{name:'hive.metastore.uris', recommendedValue:cases['hive.metastore.uris'].dependencies['hive.metastore.uris'],
 filename: 'hive-site.xml'}]);
+      configPropertyHelper.initialValue(serviceConfigProperty, cases['hive.metastore.uris'].localDB,
{'hive.metastore.uris': cases['hive.metastore.uris'].recommendedValue});
       expect(serviceConfigProperty.get('value')).to.equal(cases['hive.metastore.uris'].value);
       expect(serviceConfigProperty.get('recommendedValue')).to.equal(cases['hive.metastore.uris'].value);
     });
@@ -413,7 +413,7 @@ describe('configPropertyHelper', function () {
         recommendedValue: cases['templeton.hive.properties'].recommendedValue,
         value: cases['templeton.hive.properties'].recommendedValue
       });
-      configPropertyHelper.initialValue(serviceConfigProperty, cases['templeton.hive.properties'].localDB,
 [{name:'hive.metastore.uris', recommendedValue:cases['templeton.hive.properties'].dependencies['hive.metastore.uris'],
 filename: 'hive-site.xml'}]);
+      configPropertyHelper.initialValue(serviceConfigProperty, cases['templeton.hive.properties'].localDB,
 {'hive.metastore.uris': cases['templeton.hive.properties'].recommendedValue});
       expect(serviceConfigProperty.get('value')).to.equal(cases['templeton.hive.properties'].value);
       expect(serviceConfigProperty.get('recommendedValue')).to.equal(cases['templeton.hive.properties'].value);
     });
@@ -423,7 +423,7 @@ describe('configPropertyHelper', function () {
         name: 'yarn.resourcemanager.zk-address',
         recommendedValue: cases['yarn.resourcemanager.zk-address'].recommendedValue
       });
-      configPropertyHelper.initialValue(serviceConfigProperty, cases['yarn.resourcemanager.zk-address'].localDB,
 [{name:'clientPort', recommendedValue:cases['yarn.resourcemanager.zk-address'].dependencies['clientPort'],
 filename: 'zoo.cfg.xml'}]);
+      configPropertyHelper.initialValue(serviceConfigProperty, cases['yarn.resourcemanager.zk-address'].localDB,
 cases['yarn.resourcemanager.zk-address'].dependencies);
       expect(serviceConfigProperty.get('value')).to.equal(cases['yarn.resourcemanager.zk-address'].value);
       expect(serviceConfigProperty.get('recommendedValue')).to.equal(cases['yarn.resourcemanager.zk-address'].value);
     });


Mime
View raw message