You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/09/03 02:45:12 UTC
git commit: AMBARI-7023. Incorrect ATS metric request for non-HDP
stack with version 2.1. (jaimin)
Repository: ambari
Updated Branches:
refs/heads/trunk a010c3411 -> 13f6cac88
AMBARI-7023. Incorrect ATS metric request for non-HDP stack with version 2.1. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/13f6cac8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/13f6cac8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/13f6cac8
Branch: refs/heads/trunk
Commit: 13f6cac88fe9143bd464b6c2256b9c0fb5f86924
Parents: a010c34
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Tue Sep 2 17:44:19 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Tue Sep 2 17:44:19 2014 -0700
----------------------------------------------------------------------
.../stacks/HDP/2.0.6/services/YARN/metainfo.xml | 2 +-
.../stacks/HDP/2.1/services/YARN/metainfo.xml | 1 +
ambari-web/app/app.js | 15 +++---
.../app/controllers/global/update_controller.js | 3 +-
.../main/admin/serviceAccounts_controller.js | 17 ++++--
ambari-web/app/views/main/service/item.js | 2 +-
ambari-web/test/app_test.js | 55 --------------------
.../admin/serviceAccounts_controller_test.js | 24 ---------
8 files changed, 25 insertions(+), 94 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
index 7a02289..a53167e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
@@ -30,7 +30,7 @@
<name>RESOURCEMANAGER</name>
<displayName>ResourceManager</displayName>
<category>MASTER</category>
- <cardinality>1-2</cardinality>
+ <cardinality>1</cardinality>
<commandScript>
<script>scripts/resourcemanager.py</script>
<scriptType>PYTHON</scriptType>
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/metainfo.xml
index 0bbf30b..e110976 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/metainfo.xml
@@ -41,6 +41,7 @@
<component>
<name>RESOURCEMANAGER</name>
<category>MASTER</category>
+ <cardinality>1-2</cardinality>
<configuration-dependencies>
<config-type>capacity-scheduler</config-type>
</configuration-dependencies>
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index f4dd1c1..8ff9b63 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -66,11 +66,6 @@ module.exports = Em.Application.create({
stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.0") === 0)
}.property('currentStackVersionNumber'),
- isHadoop21Stack: function () {
- return (stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.1") === 1 ||
- stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.1") === 0)
- }.property('currentStackVersionNumber'),
-
/**
* If NameNode High Availability is enabled
* Based on <code>clusterStatus.isInstalled</code>, stack version, <code>SNameNode</code> availability
@@ -89,9 +84,13 @@ module.exports = Em.Application.create({
* @type {bool}
*/
isRMHaEnabled: function () {
- if (!this.get('isHadoop2Stack')) return false;
- return this.HostComponent.find().filterProperty('componentName', 'RESOURCEMANAGER').length > 1;
- }.property('router.clusterController.isLoaded', 'isHadoop2Stack'),
+ var result = false;
+ var rmStackComponent = App.StackServiceComponent.find().findProperty('componentName','RESOURCEMANAGER');
+ if (rmStackComponent && rmStackComponent.get('isMultipleAllowed')) {
+ result = this.HostComponent.find().filterProperty('componentName', 'RESOURCEMANAGER').length > 1;
+ }
+ return result;
+ }.property('router.clusterController.isLoaded'),
/**
* Object with utility functions for list of service names with similar behavior
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 8098213..a71f689 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -337,12 +337,13 @@ App.UpdateController = Em.Controller.extend({
updateServiceMetric: function (callback) {
var self = this;
self.set('isUpdated', false);
+ var isATSPresent = App.StackServiceComponent.find().findProperty('componentName','APP_TIMELINE_SERVER');
var conditionalFields = this.getConditionalFields(),
conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',') : '',
testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/master_components.json' : '/data/dashboard/services.json',
isFlumeInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('FLUME'),
- isATSInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('YARN') && App.get('isHadoop21Stack'),
+ isATSInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('YARN') && isATSPresent,
flumeHandlerParam = isFlumeInstalled ? 'ServiceComponentInfo/component_name=FLUME_HANDLER|' : '',
atsHandlerParam = isATSInstalled ? 'ServiceComponentInfo/component_name=APP_TIMELINE_SERVER|' : '',
haComponents = App.get('isHaEnabled') ? 'ServiceComponentInfo/component_name=JOURNALNODE|ServiceComponentInfo/component_name=ZKFC|' : '',
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
index 741597a..f06d64e 100644
--- a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
+++ b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
@@ -55,7 +55,7 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
}
}
this.setServiceConfigTags(loadedClusterSiteToTagMap);
- App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function(configGroups){
+ App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function (configGroups) {
var configSet = App.config.mergePreDefinedWithLoaded(configGroups, [], self.get('serviceConfigTags'), serviceName);
var misc_configs = configSet.configs.filterProperty('serviceName', self.get('selectedService')).filterProperty('category', 'Users and Groups').filterProperty('isVisible', true);
@@ -64,7 +64,7 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
var sortOrder = self.get('configs').filterProperty('serviceName', self.get('selectedService')).filterProperty('category', 'Users and Groups').filterProperty('isVisible', true).mapProperty('name');
- //stack, with version lower than 2.1, doesn't have Falcon service
+
self.setProxyUserGroupLabel(misc_configs);
self.set('users', self.sortByOrder(sortOrder, misc_configs));
@@ -120,8 +120,17 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
*/
setProxyUserGroupLabel: function (misc_configs) {
var proxyUserGroup = misc_configs.findProperty('name', 'proxyuser_group');
- if (proxyUserGroup && !App.get('isHadoop21Stack')) {
- proxyUserGroup.set('displayName', "Proxy group for Hive, WebHCat and Oozie");
+ //stack, with version lower than 2.1, doesn't have Falcon service
+ if (proxyUserGroup) {
+ var proxyServices = ['HIVE', 'WEBHCAT', 'OOZIE', 'FALCON'];
+ var services = Em.A([]);
+ proxyServices.forEach(function (serviceName) {
+ var stackService = App.StackService.find(serviceName);
+ if (stackService) {
+ services.push(stackService.get('displayName'));
+ }
+ }, this);
+ proxyUserGroup.set('displayName', "Proxy group for " + stringUtils.getFormattedStringFromArray(services));
}
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index 8f0e811..f99e69a 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -84,7 +84,7 @@ App.MainServiceItemView = Em.View.extend({
action: 'enableRMHighAvailability',
label: Em.I18n.t('admin.rm_highAvailability.button.enable'),
cssClass: 'icon-arrow-up',
- isHidden: !App.get('supports.resourceManagerHighAvailability') || App.get('isRMHaEnabled') || !App.get('isHadoop21Stack')
+ isHidden: !App.get('supports.resourceManagerHighAvailability') || App.get('isRMHaEnabled')
},
MOVE_COMPONENT: {
action: 'reassignMaster',
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-web/test/app_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/app_test.js b/ambari-web/test/app_test.js
index 5cf78cd..749b245 100644
--- a/ambari-web/test/app_test.js
+++ b/ambari-web/test/app_test.js
@@ -199,61 +199,6 @@ describe('App', function () {
});
});
- describe('#isHadoop21Stack', function () {
- var tests = [
- {
- v: '',
- e: false
- },
- {
- v: 'HDP',
- e: false
- },
- {
- v: 'HDP1',
- e: false
- },
- {
- v: 'HDP-1',
- e: false
- },
- {
- v: 'HDP-2.0',
- e: false
- },
- {
- v: 'HDP-2.0.1000',
- e: false
- },
- {
- v: 'HDP-2.1',
- e: true
- },
- {
- v: 'HDP-2.1.3434',
- e: true
- },
- {
- v: 'HDP-2.2',
- e: true
- },
- {
- v: 'HDP-2.2.1212',
- e: true
- }
- ];
- tests.forEach(function (test) {
- it(test.v, function () {
- App.QuickViewLinks.prototype.setQuickLinks = function () {
- };
- App.set('currentStackVersion', test.v);
- var calculated = App.get('isHadoop21Stack');
- var expected = test.e;
- expect(calculated).to.equal(expected);
- });
- });
- });
-
describe('#isHaEnabled', function () {
it('if hadoop stack version less than 2 then isHaEnabled should be false', function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/13f6cac8/ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js b/ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js
index 6e82731..ba12e00 100644
--- a/ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js
@@ -194,29 +194,5 @@ describe('App.MainAdminServiceAccountsController', function () {
controller.setProxyUserGroupLabel(misc_configs);
expect(misc_configs.findProperty('name', 'proxyuser_group')).to.be.undefined;
});
- it('proxyuser_group config defined and isHadoop21Stack is true', function () {
- var misc_configs = [Em.Object.create({
- name: 'proxyuser_group',
- displayName: 'test'
- })];
- sinon.stub(App, 'get', function(){
- return true;
- });
- controller.setProxyUserGroupLabel(misc_configs);
- expect(misc_configs.findProperty('name', 'proxyuser_group').get('displayName')).to.equal('test');
- App.get.restore();
- });
- it('proxyuser_group config defined and isHadoop21Stack is false', function () {
- var misc_configs = [Em.Object.create({
- name: 'proxyuser_group',
- displayName: 'test'
- })];
- sinon.stub(App, 'get', function(){
- return false;
- });
- controller.setProxyUserGroupLabel(misc_configs);
- expect(misc_configs.findProperty('name', 'proxyuser_group').get('displayName')).to.equal('Proxy group for Hive, WebHCat and Oozie');
- App.get.restore();
- });
})
});