You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/10/04 05:17:21 UTC
[38/50] [abbrv] git commit: AMBARI-7636 When you recommission a DN,
NM or RS it will start/stop other host components that are
started/stopped. (ababiichuk)
AMBARI-7636 When you recommission a DN, NM or RS it will start/stop other host components that are started/stopped. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/eaa67b97
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/eaa67b97
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/eaa67b97
Branch: refs/heads/branch-alerts-dev
Commit: eaa67b97dc276bc53c1399a8fd23194ad22e28fa
Parents: d5b9af7
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Fri Oct 3 19:59:47 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Fri Oct 3 20:00:01 2014 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 261 ++++++++++---------
1 file changed, 140 insertions(+), 121 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/eaa67b97/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 1f1bf8e..98819e4 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -956,86 +956,93 @@ App.MainHostDetailsController = Em.Controller.extend({
* @param {string} slaveType - slave component name
*/
doDecommissionRegionServer: function (hostNames, serviceName, componentName, slaveType) {
- App.ajax.send({
- name: 'host.host_component.recommission_and_restart',
- sender: this,
- data: {
- intervalTimeSeconds: 1,
- tolerateSize: 0,
- batches: [
- {
- "order_id": 1,
- "type": "POST",
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
- "RequestBodyInfo": {
- "RequestInfo": {
- "context": Em.I18n.t('hosts.host.regionserver.decommission.batch1'),
- "command": "DECOMMISSION",
- "parameters": {
- "slave_type": slaveType,
- "excluded_hosts": hostNames
- },
- 'operation_level': {
- level: "HOST_COMPONENT",
- cluster_name: App.get('clusterName'),
- host_name: hostNames,
- service_name: serviceName
- }
- },
- "Requests/resource_filters": [
- {"service_name": serviceName, "component_name": componentName}
- ]
+ var batches = [
+ {
+ "order_id": 1,
+ "type": "POST",
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
+ "RequestBodyInfo": {
+ "RequestInfo": {
+ "context": Em.I18n.t('hosts.host.regionserver.decommission.batch1'),
+ "command": "DECOMMISSION",
+ "exclusive" :"true",
+ "parameters": {
+ "slave_type": slaveType,
+ "excluded_hosts": hostNames
+ },
+ 'operation_level': {
+ level: "HOST_COMPONENT",
+ cluster_name: App.get('clusterName'),
+ host_name: hostNames,
+ service_name: serviceName
}
},
- {
- "order_id": 2,
- "type": "PUT",
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/host_components/" + slaveType,
- "RequestBodyInfo": {
- "RequestInfo": {
- context: Em.I18n.t('hosts.host.regionserver.decommission.batch2'),
- operation_level: {
- level: "HOST_COMPONENT",
- cluster_name: App.get('clusterName'),
- host_name: hostNames,
- service_name: serviceName || null
- }
- },
- "Body": {
- HostRoles: {
- state: "INSTALLED"
- }
- }
+ "Requests/resource_filters": [
+ {"service_name": serviceName, "component_name": componentName}
+ ]
+ }
+ }];
+ var id = 2;
+ var hAray = hostNames.split(",");
+ for (var i = 0; i < hAray.length; i++) {
+ batches.push({
+ "order_id": id,
+ "type": "PUT",
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/hosts/" + hAray[i] + "/host_components/" + slaveType,
+ "RequestBodyInfo": {
+ "RequestInfo": {
+ context: Em.I18n.t('hosts.host.regionserver.decommission.batch2'),
+ exclusive: true,
+ operation_level: {
+ level: "HOST_COMPONENT",
+ cluster_name: App.get('clusterName'),
+ host_name: hostNames,
+ service_name: serviceName || null
}
},
- {
- "order_id": 3,
- "type": "POST",
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
- "RequestBodyInfo": {
- "RequestInfo": {
- "context": Em.I18n.t('hosts.host.regionserver.decommission.batch3'),
- "command": "DECOMMISSION",
- "service_name": serviceName,
- "component_name": componentName,
- "parameters": {
- "slave_type": slaveType,
- "excluded_hosts": hostNames,
- "mark_draining_only": "true"
- },
- 'operation_level': {
- level: "HOST_COMPONENT",
- cluster_name: App.get('clusterName'),
- host_name: hostNames,
- service_name: serviceName
- }
- },
- "Requests/resource_filters": [
- {"service_name": serviceName, "component_name": componentName}
- ]
+ "Body": {
+ HostRoles: {
+ state: "INSTALLED"
}
}
- ]
+ }
+ });
+ id++
+ }
+ batches.push({
+ "order_id": id,
+ "type": "POST",
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
+ "RequestBodyInfo": {
+ "RequestInfo": {
+ "context": Em.I18n.t('hosts.host.regionserver.decommission.batch3'),
+ "command": "DECOMMISSION",
+ "service_name": serviceName,
+ "component_name": componentName,
+ "parameters": {
+ "slave_type": slaveType,
+ "excluded_hosts": hostNames,
+ "mark_draining_only": true
+ },
+ 'operation_level': {
+ level: "HOST_COMPONENT",
+ cluster_name: App.get('clusterName'),
+ host_name: hostNames,
+ service_name: serviceName
+ }
+ },
+ "Requests/resource_filters": [
+ {"service_name": serviceName, "component_name": componentName}
+ ]
+ }
+ });
+ App.ajax.send({
+ name: 'host.host_component.recommission_and_restart',
+ sender: this,
+ data: {
+ intervalTimeSeconds: 1,
+ tolerateSize: 0,
+ batches: batches
},
success: 'decommissionSuccessCallback',
error: 'decommissionErrorCallback'
@@ -1082,59 +1089,69 @@ App.MainHostDetailsController = Em.Controller.extend({
var context_1 = Em.I18n.t(contextNameString_1);
var contextNameString_2 = 'requestInfo.startHostComponent.' + slaveType.toLowerCase();
var startContext = Em.I18n.t(contextNameString_2);
+ var params = {
+ "slave_type": slaveType,
+ "included_hosts": hostNames
+ };
+ if (serviceName == "HBASE") {
+ params.mark_draining_only = true;
+ }
+ var batches = [
+ {
+ "order_id": 1,
+ "type": "POST",
+ "uri": App.apiPrefix + "/clusters/" + App.get('clusterName') + "/requests",
+ "RequestBodyInfo": {
+ "RequestInfo": {
+ "context": context_1,
+ "command": "DECOMMISSION",
+ "exclusive":"true",
+ "parameters": params,
+ 'operation_level': {
+ level: "HOST_COMPONENT",
+ cluster_name: App.get('clusterName'),
+ host_name: hostNames,
+ service_name: serviceName
+ }
+ },
+ "Requests/resource_filters": [
+ {"service_name": serviceName, "component_name": componentName}
+ ]
+ }
+ }];
+ var id = 2;
+ var hAray = hostNames.split(",");
+ for (var i = 0; i < hAray.length; i++) {
+ batches.push( {
+ "order_id": id,
+ "type": "PUT",
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/hosts/" + hAray[i] + "/host_components/" + slaveType,
+ "RequestBodyInfo": {
+ "RequestInfo": {
+ context: startContext,
+ operation_level: {
+ level: "HOST_COMPONENT",
+ cluster_name: App.get('clusterName'),
+ host_name: hostNames,
+ service_name: serviceName || null
+ }
+ },
+ "Body": {
+ HostRoles: {
+ state: "STARTED"
+ }
+ }
+ }
+ });
+ id++;
+ }
App.ajax.send({
name: 'host.host_component.recommission_and_restart',
sender: this,
data: {
intervalTimeSeconds: 1,
tolerateSize: 1,
- batches: [
- {
- "order_id": 1,
- "type": "POST",
- "uri": App.apiPrefix + "/clusters/" + App.get('clusterName') + "/requests",
- "RequestBodyInfo": {
- "RequestInfo": {
- "context": context_1,
- "command": "DECOMMISSION",
- "parameters": {
- "slave_type": slaveType,
- "included_hosts": hostNames
- },
- 'operation_level': {
- level: "HOST_COMPONENT",
- cluster_name: App.get('clusterName'),
- host_name: hostNames,
- service_name: serviceName
- }
- },
- "Requests/resource_filters": [
- {"service_name": serviceName, "component_name": componentName}
- ]
- }
- },
- {
- "order_id": 2,
- "type": "PUT",
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/host_components/" + slaveType,
- "RequestBodyInfo": {
- "RequestInfo": {
- context: startContext,
- operation_level: {
- level: "HOST_COMPONENT",
- cluster_name: App.get('clusterName'),
- host_name: hostNames,
- service_name: serviceName || null
- }
- },
- "Body": {
- HostRoles: {
- state: "STARTED"
- }
- }
- }
- }
- ]
+ batches: batches
},
success: 'decommissionSuccessCallback',
error: 'decommissionErrorCallback'
@@ -1169,6 +1186,7 @@ App.MainHostDetailsController = Em.Controller.extend({
"RequestInfo": {
"context": context_1,
"command": "DECOMMISSION",
+ "exclusive":"true",
"parameters": {
"slave_type": slaveType,
"included_hosts": hostNames
@@ -1195,6 +1213,7 @@ App.MainHostDetailsController = Em.Controller.extend({
"command": "RESTART",
"service_name": serviceName,
"component_name": slaveType,
+ "exclusive":"true",
"hosts": hostNames
}
}