Revert "AMBARI-20429 - Warn users about pending requests while trying to enable Interactive Query immediately after disabling it (Vivek Subramanian via rzang)"
This reverts commit dd7f46f10df8b31476bb17e427775c4acf8c303d.
diff --git a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
index b1e3397..e2c5fa6 100644
--- a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
+++ b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
@@ -62,13 +62,15 @@
this.set('configWidgetContext', context);
this.set('content', context.get('controller.content'));
this.set('configActionComponent', hostComponent);
-
+ var missingDependentServices = this.getAllMissingDependentServices();
+ var isNonWizardPage = !this.get('content.controllerName');
switch (action) {
case 'ADD':
- if (hostComponent.componentName == "HIVE_SERVER_INTERACTIVE") {
- this.getPendingBatchRequests(hostComponent);
+ if (missingDependentServices.length && isNonWizardPage) {
+ this.showInstallServicesPopup(missingDependentServices);
} else {
- this.showPopup(hostComponent);
+ this.set('mastersToCreate', [hostComponent.componentName]);
+ this.showAssignComponentPopup();
}
break;
case 'DELETE':
@@ -78,71 +80,6 @@
}
},
- getPendingBatchRequests: function(hostComponent) {
- var self = this;
- // Send Ajax request to get status of pending batch requests
- App.ajax.send({
- name : 'request_schedule.get.pending',
- sender: self,
- error : 'pendingBatchRequestsAjaxError',
- success: 'pendingBatchRequestsAjaxSuccess',
- data: {
- hostComponent: hostComponent
- }
- });
- },
-
- pendingBatchRequestsAjaxError: function(data) {
- var error = Em.I18n.t('services.service.actions.run.yarnRefreshQueues.error');
- if(data && data.responseText){
- try {
- var json = $.parseJSON(data.responseText);
- error += json.message;
- } catch (err) {}
- }
- App.showAlertPopup(Em.I18n.t('services.service.actions.run.yarnRefreshQueues.error'), error, null);
- },
-
- pendingBatchRequestsAjaxSuccess : function(data, opt, params) {
- var self = this;
- var showAlert = false;
- if (data.hasOwnProperty('items') && data.items.length > 0) {
- data.items.forEach( function(_item) {
- _item.RequestSchedule.batch.batch_requests.forEach( function(batchRequest) {
- // Check if a DELETE request on HIVE_SERVER_INTERACTIVE is in progress
- if (batchRequest.request_type == "DELETE" && batchRequest.request_uri.indexOf("HIVE_SERVER_INTERACTIVE") > -1) {
- showAlert = true;
- }
- });
- });
- }
- if (showAlert) {
- App.showAlertPopup(Em.I18n.t('services.service.actions.hsi.alertPopup.header'), Em.I18n.t('services.service.actions.hsi.alertPopup.body'), function() {
- var configWidgetContext = self.get('configWidgetContext');
- var config = self.get('configWidgetContext.config');
- configWidgetContext.toggleProperty('controller.forceUpdateBoundaries');
- var value = config.get('initialValue');
- config.set('value', value);
- configWidgetContext.setValue(value);
- configWidgetContext.sendRequestRorDependentConfigs(config);
- this.hide();
- });
- } else {
- this.showPopup(params.hostComponent);
- }
- },
-
- showPopup: function(hostComponent) {
- var missingDependentServices = this.getAllMissingDependentServices();
- var isNonWizardPage = !this.get('content.controllerName');
- if (missingDependentServices.length && isNonWizardPage) {
- this.showInstallServicesPopup(missingDependentServices);
- } else {
- this.set('mastersToCreate', [hostComponent.componentName]);
- this.showAssignComponentPopup();
- }
- },
-
/**
* Used to set showAddControl/showRemoveControl flag
* @param componentName
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 8173ca3..a2a9d60 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1963,8 +1963,6 @@
'services.service.actions.run.runHawqCheck.label':'Run HAWQ Config Check',
'services.service.actions.manage_configuration_groups.short':'Manage Config Groups',
'services.service.actions.serviceActions':'Service Actions',
- 'services.service.actions.hsi.alertPopup.header':'Cannot enable Interactive Query',
- 'services.service.actions.hsi.alertPopup.body':'You cannot enable Interactive Query now because Interactive Query is in the process of being disabled. This may take a few minutes. Try again later.',
'services.service.delete.popup.header': 'Delete Service',
'services.service.delete.popup.kerberos': 'The Kerberos Service <i>cannot be deleted</i> because Kerberos is ' +
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 70ecb23..8be3b62 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2326,10 +2326,6 @@
'real': '/clusters/{clusterName}/request_schedules/{request_schedule_id}',
'mock': ''
},
- 'request_schedule.get.pending': {
- 'real': '/clusters/{clusterName}/request_schedules?fields=*&(RequestSchedule/status.in(SCHEDULED,IN_PROGRESS))',
- 'mock': ''
- },
'restart.hostComponents': {
'real': '/clusters/{clusterName}/requests',
'mock': '',
diff --git a/ambari-web/app/views/common/configs/widgets/config_widget_view.js b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
index 3a1e24d..cb5d5b9 100644
--- a/ambari-web/app/views/common/configs/widgets/config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
@@ -482,9 +482,6 @@
this.set('controller.saveInProgress', true);
assignMasterOnStep7Controller.execute(this, 'ADD', hostComponent);
} else {
- if(hostComponent.componentName == "HIVE_SERVER_INTERACTIVE") {
- assignMasterOnStep7Controller.execute(this, 'ADD', hostComponent);
- }
assignMasterOnStep7Controller.clearComponentsToBeDeleted(hostComponent.componentName);
}
break;