ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject ambari git commit: AMBARI-14781: Clean up code for HAWQ IMMEDIATE CLUSTER STOP custom command (mithmatt via jaoki)
Date Tue, 26 Jan 2016 00:54:10 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk f755efc52 -> b2b1122db


AMBARI-14781: Clean up code for HAWQ IMMEDIATE CLUSTER STOP custom command (mithmatt via jaoki)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b2b1122d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b2b1122d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b2b1122d

Branch: refs/heads/trunk
Commit: b2b1122dbf1b540450dc52baae63c48ec24568ad
Parents: f755efc
Author: Jun Aoki <jaoki@apache.org>
Authored: Mon Jan 25 16:53:52 2016 -0800
Committer: Jun Aoki <jaoki@apache.org>
Committed: Mon Jan 25 16:53:52 2016 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js | 25 ++++----------------
 ambari-web/app/messages.js                      |  1 -
 ambari-web/app/utils/ajax/ajax.js               | 20 ----------------
 3 files changed, 4 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b2b1122d/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 406d940..b8ad011 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -531,38 +531,21 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
     var controller = this;
     return App.showConfirmationPopup(function() {
       App.ajax.send({
-        name: 'service.item.immediateStopHawqCluster',
+        name: 'service.item.executeCustomCommand',
         sender: controller,
         data: {
           command: context.command,
           context: Em.I18n.t('services.service.actions.run.immediateStopHawqCluster.context'),
           hosts: App.Service.find(context.service).get('hostComponents').findProperty('componentName',
'HAWQMASTER').get('hostName'),
           serviceName: context.service,
-          componentName: context.component,
+          componentName: context.component
         },
-        success : 'executeImmediateStopHawqClusterCmdSuccessCallback',
-        error : 'executeImmediateStopHawqClusterCmdErrorCallback'
+        success : 'executeCustomCommandSuccessCallback',
+        error : 'executeCustomCommandErrorCallback'
       });
     });
   },
 
-  executeImmediateStopHawqClusterCmdSuccessCallback  : function(data, ajaxOptions, params)
{
-    if (data.Requests.id) {
-      App.router.get('backgroundOperationsController').showPopup();
-    }
-  },
-
-  executeImmediateStopHawqClusterCmdErrorCallback : function(data) {
-    var error = Em.I18n.t('services.service.actions.run.immediateStopHawqCluster.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.immediateStopHawqCluster.error'),
error);
-  },
-
   /**
    * On click handler for rebalance Hdfs command from items menu
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2b1122d/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f9f389c..a153408 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1681,7 +1681,6 @@ Em.I18n.translations = {
   'services.service.actions.run.immediateStopHawqCluster.context':'Stop HAWQ Cluster (Immediate
Mode)',
   'services.service.actions.run.immediateStopHawqSegment.label':'Stop (Immediate Mode)',
   'services.service.actions.run.immediateStopHawqSegment.context':'Stop HAWQ Segment (Immediate
Mode)',
-  'services.service.actions.run.immediateStopHawqCluster.error': 'Error during remote command:
',
   'services.service.actions.manage_configuration_groups.short':'Manage Config Groups',
   'services.service.actions.serviceActions':'Service Actions',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2b1122d/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 4762d34..c4a1611 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -629,26 +629,6 @@ var urls = {
       }
     }
   },
-  'service.item.immediateStopHawqCluster': {
-    'real': '/clusters/{clusterName}/requests',
-    'mock': '',
-    'format': function (data) {
-      return {
-        type: 'POST',
-        data: JSON.stringify({
-          RequestInfo: {
-            'context': data.context,
-            'command': data.command
-          },
-          "Requests/resource_filters": [{
-            "service_name": data.serviceName,
-            "component_name": data.componentName,
-            'hosts': data.hosts
-          }]
-        })
-      }
-    }
-  },
   /*************************CONFIG THEME****************************************/
 
   'configs.theme': {


Mime
View raw message