فهرست منبع

AMBARI-17293 Ambari does not refresh yarn queues when HiveServerIntearctive component is restarted. Second patch. (akovalenko)

Aleksandr Kovalenko 9 سال پیش
والد
کامیت
50c297ba52
2فایلهای تغییر یافته به همراه22 افزوده شده و 22 حذف شده
  1. 19 19
      ambari-web/app/controllers/main/host/details.js
  2. 3 3
      ambari-web/test/controllers/main/host/details_test.js

+ 19 - 19
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
           }]
         }
       }

+ 3 - 3
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;
     });
   });