Repository: ambari Updated Branches: refs/heads/trunk 917988f76 -> 15d7e2035
AMBARI-17293 Ambari does not refresh yarn queues when HiveServerIntearctive component is restarted. Second patch. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/15d7e203 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/15d7e203 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/15d7e203 Branch: refs/heads/trunk Commit: 15d7e20355f1f8428d1a776feef597fe0d1df694 Parents: 917988f Author: Aleksandr Kovalenko <[email protected]> Authored: Wed Jun 29 18:11:32 2016 +0300 Committer: Aleksandr Kovalenko <[email protected]> Committed: Wed Jun 29 20:58:21 2016 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/host/details.js | 38 ++++++++++---------- .../test/controllers/main/host/details_test.js | 6 ++-- 2 files changed, 22 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/15d7e203/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 517adb2..74255b9 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -526,7 +526,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow }); } else if (this.get('refreshYARNQueueComponents').contains(component.get('componentName'))) { return App.showConfirmationPopup(function () { - self.restartComponentAndRefreshYARNQueue(component); + self.refreshYARNQueueAndRestartComponent(component); }); } else { return App.showConfirmationPopup(function () { @@ -535,7 +535,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow } }, - restartComponentAndRefreshYARNQueue: function (component) { + refreshYARNQueueAndRestartComponent: function (component) { var componentToRestartHost = App.HostComponent.find().findProperty('componentName', component.get('componentName')).get('hostName'); var resourceManagerHost = App.HostComponent.find().findProperty('componentName', 'RESOURCEMANAGER').get('hostName'); var batches = [ @@ -545,19 +545,14 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow "uri": App.apiPrefix + "/clusters/" + App.get('clusterName') + "/requests", "RequestBodyInfo": { "RequestInfo": { - "context": "Restart " + component.get('displayName'), - "command": "RESTART", - "operation_level": { - "level": "HOST_COMPONENT", - "cluster_name": App.get('clusterName'), - "service_name": component.get('service.serviceName'), - "hostcomponent_name": component.get('componentName') - } + "context": "Refresh YARN Capacity Scheduler", + "command": "REFRESHQUEUES", + "parameters/forceRefreshConfigTags": "capacity-scheduler" }, "Requests/resource_filters": [{ - "service_name": component.get('service.serviceName'), - "component_name": component.get('componentName'), - "hosts": componentToRestartHost + "service_name": "YARN", + "component_name": "RESOURCEMANAGER", + "hosts": resourceManagerHost }] } }, @@ -567,14 +562,19 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow "uri": App.apiPrefix + "/clusters/" + App.get('clusterName') + "/requests", "RequestBodyInfo": { "RequestInfo": { - "context": "Refresh YARN Capacity Scheduler", - "command": "REFRESHQUEUES", - "parameters/forceRefreshConfigTags": "capacity-scheduler" + "context": "Restart " + component.get('displayName'), + "command": "RESTART", + "operation_level": { + "level": "HOST_COMPONENT", + "cluster_name": App.get('clusterName'), + "service_name": component.get('service.serviceName'), + "hostcomponent_name": component.get('componentName') + } }, "Requests/resource_filters": [{ - "service_name": "YARN", - "component_name": "RESOURCEMANAGER", - "hosts": resourceManagerHost + "service_name": component.get('service.serviceName'), + "component_name": component.get('componentName'), + "hosts": componentToRestartHost }] } } http://git-wip-us.apache.org/repos/asf/ambari/blob/15d7e203/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 971d0cd..bbf7fce 100644 --- a/ambari-web/test/controllers/main/host/details_test.js +++ b/ambari-web/test/controllers/main/host/details_test.js @@ -472,13 +472,13 @@ describe('App.MainHostDetailsController', function () { sinon.spy(App, "showConfirmationPopup"); sinon.stub(batchUtils, "restartHostComponents", Em.K); sinon.stub(controller, 'checkNnLastCheckpointTime', Em.clb); - sinon.stub(controller, "restartComponentAndRefreshYARNQueue", Em.K); + sinon.stub(controller, "refreshYARNQueueAndRestartComponent", Em.K); }); afterEach(function () { App.showConfirmationPopup.restore(); batchUtils.restartHostComponents.restore(); controller.checkNnLastCheckpointTime.restore(); - controller.restartComponentAndRefreshYARNQueue.restore(); + controller.refreshYARNQueueAndRestartComponent.restore(); }); it('popup should be displayed', function () { @@ -508,7 +508,7 @@ describe('App.MainHostDetailsController', function () { }; var confirmPopup = controller.restartComponent(event); confirmPopup.onPrimary(); - expect(controller.restartComponentAndRefreshYARNQueue.calledOnce).to.be.true; + expect(controller.refreshYARNQueueAndRestartComponent.calledOnce).to.be.true; }); });
