You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2015/01/05 14:08:46 UTC

ambari git commit: AMBARI-8986. Incorrect Validation in Customize Services Page-Mapreduce2 tab (onechiporenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk c205e06fa -> a886ee7da


AMBARI-8986. Incorrect Validation in Customize Services Page-Mapreduce2 tab (onechiporenko)


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

Branch: refs/heads/trunk
Commit: a886ee7da94e16c7e9954ee0b7f255f09f98a89b
Parents: c205e06
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Mon Jan 5 14:29:35 2015 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Mon Jan 5 14:29:35 2015 +0200

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    |  2 +-
 .../app/controllers/wizard/step7_controller.js  | 30 +++++---
 .../configs/config_recommendation_popup.hbs     | 77 ++++++++++----------
 .../test/controllers/wizard/step7_test.js       | 74 ++++++++++++++++++-
 4 files changed, 130 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a886ee7d/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 f3026fa..794a0d9 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -2385,7 +2385,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
   /**
    * set host name(s) property for component
    * @param {String} serviceName - service name of component
-   * @param {String} componentName - component name whic host we want to know
+   * @param {String} componentName - component name which host we want to know
    * @param {String} hostProperty - name of host property for current component
    * @param {Boolean} multiple - true if can be more than one component
    * @method setHostForService

http://git-wip-us.apache.org/repos/asf/ambari/blob/a886ee7d/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 f497642..d777488 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -714,21 +714,29 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
         });
         serviceConfigs.findProperty('serviceName', 'HDFS').configs = c;
       }
+    }
 
-      // Remove Notifications from MISC if it isn't Installer Controller
-      if (this.get('wizardController.name') !== 'installerController') {
-        var miscService = serviceConfigs.findProperty('serviceName', 'MISC');
-        if (miscService) {
-          c = miscService.configs;
-          removedConfigs = c.filterProperty('category', 'Notifications');
-          removedConfigs.map(function (config) {
-            c = c.without(config);
-          });
-          miscService.configs = c;
-        }
+    // Remove Notifications from MISC if it isn't Installer Controller
+    if (this.get('wizardController.name') !== 'installerController') {
+      var miscService = serviceConfigs.findProperty('serviceName', 'MISC');
+      if (miscService) {
+        c = miscService.configs;
+        removedConfigs = c.filterProperty('category', 'Notifications');
+        removedConfigs.map(function (config) {
+          c = c.without(config);
+        });
+        miscService.configs = c;
       }
     }
 
+    if (!App.get('isHadoopWindowsStack')) {
+      c = serviceConfigs.findProperty('serviceName', 'HDFS').configs;
+      c.filterProperty('category', 'MetricsSink').map(function (config) {
+        c = c.without(config);
+      });
+      serviceConfigs.findProperty('serviceName', 'HDFS').configs = c;
+    }
+
     this.set('stepConfigs', serviceConfigs);
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a886ee7d/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
index 3c5a0cf..2724793 100644
--- a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
+++ b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
@@ -21,49 +21,48 @@
   <table class="table no-borders">
     <thead>
     <tr>
-      <th>
-        {{t common.service}}
-      </th>
-      <th>
-        {{t common.property}}
-      </th>
-      <th>
-        {{t common.value}}
-      </th>
-      <th>
-        {{t common.description}}
-      </th>
+      <th>{{t common.service}}</th>
+      <th>{{t common.property}}</th>
+      <th>{{t common.value}}</th>
+      <th>{{t common.description}}</th>
     </tr>
     </thead>
     <tbody>
-    {{#each service in stepConfigs}}
-      {{#each property in service.configs}}
-        {{#if property.warn}}
-          <tr>
-            <td>
-              {{property.serviceName}}
-            </td>
-            <td>
-              {{property.name}}
-            </td>
-            <td>
-              {{property.value}}
-            </td>
-            <td>
-              {{property.description}}<br/>
-              <strong>{{property.warnMessage}}</strong>
-            </td>
-          </tr>
-        {{/if}}
+      {{#each service in stepConfigs}}
+        {{#each property in service.configs}}
+          {{#if property.warn}}
+            <tr>
+              <td>{{property.serviceName}}</td>
+              <td>{{property.name}}</td>
+              <td>{{property.value}}</td>
+              <td>
+                {{property.description}}<br/>
+                <strong>{{property.warnMessage}}</strong>
+              </td>
+            </tr>
+          {{/if}}
+          {{#if property.error}}
+            {{#if property.isVisible}}
+              <tr>
+                <td>{{property.serviceName}}</td>
+                <td>{{property.name}}</td>
+                <td>{{property.value}}</td>
+                <td>
+                  {{property.description}}<br/>
+                  <strong>{{property.errorMessage}}</strong>
+                </td>
+              </tr>
+            {{/if}}
+          {{/if}}
+        {{/each}}
+      {{/each}}
+      {{#each message in configValidationGlobalMessage}}
+        <tr>
+          <td>{{message.serviceName}}</td>
+          <td>{{message.propertyName}}</td>
+          <td colspan="2">{{message.warnMessage}} in {{message.filename}}</td>
+        </tr>
       {{/each}}
-    {{/each}}
-    {{#each message in configValidationGlobalMessage}}
-      <tr>
-        <td>{{message.serviceName}}</td>
-        <td>{{message.propertyName}}</td>
-        <td colspan="2">{{message.warnMessage}} in {{message.filename}}</td>
-      </tr>
-    {{/each}}
     </tbody>
   </table>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a886ee7d/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index 7cbb35e..b49b07e 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -854,6 +854,7 @@ describe('App.InstallerStep7Controller', function () {
   });
 
   describe('#setStepConfigs', function () {
+
     beforeEach(function () {
       installerStep7Controller.reopen({
         content: {services: []},
@@ -864,12 +865,14 @@ describe('App.InstallerStep7Controller', function () {
         })
       });
     });
+
     afterEach(function () {
       App.config.renderConfigs.restore();
     });
+
     it('if wizard isn\'t addService, should set output of App.config.renderConfigs', function () {
       var serviceConfigs = Em.A([
-        {},
+        {serviceName:'HDFS', configs: []},
         {}
       ]);
       sinon.stub(App.config, 'renderConfigs', function () {
@@ -879,8 +882,9 @@ describe('App.InstallerStep7Controller', function () {
       installerStep7Controller.setStepConfigs([], []);
       expect(installerStep7Controller.get('stepConfigs')).to.eql(serviceConfigs);
     });
+
     it('addServiceWizard used', function () {
-      var serviceConfigs = Em.A([Em.Object.create({serviceName: 's1'}), Em.Object.create({serviceName: 's2'})]);
+      var serviceConfigs = Em.A([Em.Object.create({serviceName: 'HDFS', configs: []}), Em.Object.create({serviceName: 's2'})]);
       installerStep7Controller.set('wizardController.name', 'addServiceController');
       installerStep7Controller.reopen({selectedServiceNames: ['s2']});
       sinon.stub(App.config, 'renderConfigs', function () {
@@ -890,6 +894,7 @@ describe('App.InstallerStep7Controller', function () {
       expect(installerStep7Controller.get('stepConfigs').everyProperty('showConfig', true)).to.equal(true);
       expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 's2').get('selected')).to.equal(true);
     });
+
     it('addServiceWizard used, HA enabled', function () {
       sinon.stub(App, 'get', function (k) {
         if (k === 'isHaEnabled') {
@@ -921,6 +926,71 @@ describe('App.InstallerStep7Controller', function () {
       expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(2);
       App.get.restore();
     });
+
+    it('not windows stack', function () {
+
+      var s = sinon.stub(App, 'get');
+      s.withArgs('isHadoopWindowsStack').returns(false);
+      s.withArgs('isHaEnabled').returns(false);
+
+      var serviceConfigs = Em.A([
+        Em.Object.create({
+          serviceName: 'HDFS',
+          configs: [
+            {category: 'MetricsSink'},
+            {category: 'MetricsSink'},
+            {category: 'NameNode'},
+            {category: 'NameNode'},
+            {category: 'MetricsSink'}
+          ]
+        }),
+        Em.Object.create({serviceName: 's2'})]
+      );
+
+      installerStep7Controller.reopen({selectedServiceNames: ['HDFS', 's2']});
+      sinon.stub(App.config, 'renderConfigs', function () {
+        return serviceConfigs;
+      });
+      installerStep7Controller.setStepConfigs([], []);
+
+      expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(2);
+
+      s.restore();
+
+    });
+
+    it('windows stack', function () {
+
+      var s = sinon.stub(App, 'get');
+      s.withArgs('isHadoopWindowsStack').returns(true);
+      s.withArgs('isHaEnabled').returns(false);
+
+      var serviceConfigs = Em.A([
+        Em.Object.create({
+          serviceName: 'HDFS',
+          configs: [
+            {category: 'MetricsSink'},
+            {category: 'MetricsSink'},
+            {category: 'NameNode'},
+            {category: 'NameNode'},
+            {category: 'MetricsSink'}
+          ]
+        }),
+        Em.Object.create({serviceName: 's2'})]
+      );
+
+      installerStep7Controller.reopen({selectedServiceNames: ['HDFS', 's2']});
+      sinon.stub(App.config, 'renderConfigs', function () {
+        return serviceConfigs;
+      });
+      installerStep7Controller.setStepConfigs([], []);
+
+      expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(5);
+
+      s.restore();
+
+    });
+
   });
 
   describe('#checkHostOverrideInstaller', function () {