You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/03/02 18:58:14 UTC
ambari git commit: AMBARI-9873. Restart Yarn failed after Ambari only
upgrade from 1.6.1 to 2.0.0 and adding Host and Zookeeper Server at this
host. (alexantonenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 70b912c6a -> 37e0d6d51
AMBARI-9873. Restart Yarn failed after Ambari only upgrade from 1.6.1 to 2.0.0 and adding Host and Zookeeper Server at this host. (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/37e0d6d5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/37e0d6d5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/37e0d6d5
Branch: refs/heads/trunk
Commit: 37e0d6d510f7325a8d77943fa9ebb818000da7a6
Parents: 70b912c
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Mar 2 19:35:12 2015 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Mar 2 19:35:12 2015 +0200
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 22 +++---
.../test/controllers/main/host/details_test.js | 74 ++++++++++++++++++++
2 files changed, 87 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e0d6d5/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 3adb742..5eac7ca 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -696,7 +696,7 @@ App.MainHostDetailsController = Em.Controller.extend({
properties = group.properties;
for (var site in properties) {
- if (!properties.hasOwnProperty(site)) continue;
+ if (!properties.hasOwnProperty(site) || Em.isNone(properties[site])) continue;
desiredConfigs.push({
"type": site,
"tag": tag,
@@ -917,16 +917,20 @@ App.MainHostDetailsController = Em.Controller.extend({
'hive-site': attributes['hive-site'],
'webhcat-site': attributes['webhcat-site']
}
- },
- {
- properties: {
- 'yarn-site': configs['yarn-site']
- },
- properties_attributes: {
- 'yarn-site': attributes['yarn-site']
- }
}
];
+ if ((App.Service.find().someProperty('serviceName', 'YARN') && App.get('isHadoop22Stack')) || App.get('isRMHaEnabled')) {
+ groups.push(
+ {
+ 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/37e0d6d5/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 8f23915..b9612e4 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -682,6 +682,61 @@ describe('App.MainHostDetailsController', function () {
describe('#saveZkConfigs()', function () {
+ var yarnCases = [
+ {
+ isYARNInstalled: true,
+ isHadoop22Stack: true,
+ isRMHaEnabled: true,
+ shouldYarnSiteBeModified: true,
+ title: 'HDP 2.2, YARN installed, RM HA enabled'
+ },
+ {
+ isYARNInstalled: true,
+ isHadoop22Stack: false,
+ isRMHaEnabled: true,
+ shouldYarnSiteBeModified: true,
+ title: 'HDP < 2.2, YARN installed, RM HA enabled'
+ },
+ {
+ isYARNInstalled: true,
+ isHadoop22Stack: true,
+ isRMHaEnabled: false,
+ shouldYarnSiteBeModified: true,
+ title: 'HDP 2.2, YARN installed, RM HA disabled'
+ },
+ {
+ isYARNInstalled: false,
+ isHadoop22Stack: true,
+ isRMHaEnabled: false,
+ shouldYarnSiteBeModified: false,
+ title: 'HDP 2.2, YARN not installed'
+ },
+ {
+ isYARNInstalled: true,
+ isHadoop22Stack: false,
+ isRMHaEnabled: false,
+ shouldYarnSiteBeModified: false,
+ title: 'HDP < 2.2, YARN installed, RM HA disabled'
+ },
+ {
+ isYARNInstalled: false,
+ isHadoop22Stack: false,
+ isRMHaEnabled: false,
+ shouldYarnSiteBeModified: false,
+ title: 'HDP < 2.2, YARN not installed'
+ }
+ ],
+ yarnData = {
+ items: [
+ {
+ type: 'yarn-site',
+ properties: {
+ p: 'v'
+ }
+ }
+ ]
+ };
+
beforeEach(function () {
sinon.stub(controller, "getZkServerHosts", Em.K);
sinon.stub(controller, "concatZkNames", Em.K);
@@ -700,6 +755,25 @@ describe('App.MainHostDetailsController', function () {
controller.saveZkConfigs(data);
expect(controller.saveConfigsBatch.calledOnce).to.be.true;
});
+
+ yarnCases.forEach(function (item) {
+ it(item.title, function () {
+ var servicesMock = item.isYARNInstalled ? [
+ {
+ serviceName: 'YARN'
+ }
+ ] : [];
+ sinon.stub(App, 'get').withArgs('isHadoop22Stack').returns(item.isHadoop22Stack).
+ withArgs('isRMHaEnabled').returns(item.isRMHaEnabled);
+ sinon.stub(App.Service, 'find').returns(servicesMock);
+ controller.saveZkConfigs(yarnData);
+ expect(controller.saveConfigsBatch.firstCall.args[0].someProperty('properties.yarn-site')).to.equal(item.shouldYarnSiteBeModified);
+ expect(controller.saveConfigsBatch.firstCall.args[0].someProperty('properties_attributes.yarn-site')).to.equal(item.shouldYarnSiteBeModified);
+ App.get.restore();
+ App.Service.find.restore();
+ });
+ });
+
});
describe("#saveConfigsBatch()", function() {