Repository: ambari Updated Branches: refs/heads/branch-2.5 00a9399dc -> 3f28809f2
AMBARI-19409. Auto refresh yarn queues when capacity scheduler config is changed from hive configs page.(Vivek Subramanian via xiwang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3f28809f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3f28809f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3f28809f Branch: refs/heads/branch-2.5 Commit: 3f28809f2d225f790daf03a0523f718a19f15191 Parents: 00a9399 Author: Xi Wang <xiw...@apache.org> Authored: Fri Jan 6 17:08:06 2017 -0800 Committer: Xi Wang <xiw...@apache.org> Committed: Fri Jan 6 17:08:06 2017 -0800 ---------------------------------------------------------------------- .../configs/component_actions_by_configs.js | 11 ++++++++--- .../app/models/configs/theme/config_action.js | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3f28809f/ambari-web/app/mixins/main/service/configs/component_actions_by_configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/main/service/configs/component_actions_by_configs.js b/ambari-web/app/mixins/main/service/configs/component_actions_by_configs.js index 11ee3ac..ba30dcd 100644 --- a/ambari-web/app/mixins/main/service/configs/component_actions_by_configs.js +++ b/ambari-web/app/mixins/main/service/configs/component_actions_by_configs.js @@ -61,10 +61,15 @@ App.ComponentActionsByConfigs = Em.Mixin.create({ if (configs.length) { if(config_action.get('fileName') === 'capacity-scheduler.xml' && !self.isYarnQueueRefreshed) { - self.configAction = config_action; - App.showConfirmationPopup(function () { + if(self.get('content.serviceName') === 'HIVE') { + // Auto refresh yarn capacity scheduler if capacity-scheduler configs are changed from Hive configs page self.popupPrimaryButtonCallback(config_action); - }, config_action.get('popupProperties').body, null, Em.I18n.t('popup.confirmation.commonHeader'), config_action.get('popupProperties').primaryButton.label, false, 'refresh_yarn_queues') + } else { + self.configAction = config_action; + App.showConfirmationPopup(function () { + self.popupPrimaryButtonCallback(config_action); + }, config_action.get('popupProperties').body, null, Em.I18n.t('popup.confirmation.commonHeader'), config_action.get('popupProperties').primaryButton.label, false, 'refresh_yarn_queues') + } } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3f28809f/ambari-web/app/models/configs/theme/config_action.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/configs/theme/config_action.js b/ambari-web/app/models/configs/theme/config_action.js index 27955d5..905fecb 100644 --- a/ambari-web/app/models/configs/theme/config_action.js +++ b/ambari-web/app/models/configs/theme/config_action.js @@ -64,5 +64,25 @@ App.ConfigAction.FIXTURES = [ if:'${hive-interactive-env/enable_hive_interactive}', then:'add', else: 'delete' + }, + { + id: 2, + service_name: 'YARN', + component_name: 'RESOURCEMANAGER', + config_name: "capacity-scheduler", + file_name: "capacity-scheduler.xml", + action_type: "showPopup", + popup_properties: { + primaryButton: { + label: Em.I18n.t('popup.confirmation.refreshYarnQueues.buttonText'), + metaData: { + name: 'service.item.refreshQueueYarnRequest', + command: "REFRESHQUEUES", + context: Em.I18n.t('services.service.actions.run.yarnRefreshQueues.context') + } + }, + body: Em.I18n.t('popup.confirmation.refreshYarnQueues.body'), + errorMessage: Em.I18n.t('services.service.actions.run.yarnRefreshQueues.error') + } } ];