You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2014/02/03 12:05:13 UTC
git commit: AMBARI-4500 Modify post calls on pre-deploy step. (atkach)
Updated Branches:
refs/heads/trunk 61ad24e7b -> 460c0d5f0
AMBARI-4500 Modify post calls on pre-deploy step. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/460c0d5f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/460c0d5f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/460c0d5f
Branch: refs/heads/trunk
Commit: 460c0d5f09956ad8ad4a66e5b4a7f9ed6fb8c535
Parents: 61ad24e
Author: atkach <at...@hortonworks.com>
Authored: Mon Feb 3 13:02:44 2014 +0200
Committer: atkach <at...@hortonworks.com>
Committed: Mon Feb 3 13:02:44 2014 +0200
----------------------------------------------------------------------
.../app/controllers/wizard/step8_controller.js | 42 +++++++-------------
1 file changed, 15 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/460c0d5f/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 7e39e47..0052f44 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -979,31 +979,19 @@ App.WizardStep8Controller = Em.Controller.extend({
return;
}
- // currently we are specifying the predicate as a query string.
- // this can hit a ~4000-character limit in Jetty server.
- // chunk to multiple calls if needed
- // var hostsPredicate = hostNames.map(function (hostName) {
- // return 'Hosts/host_name=' + hostName;
- // }).join('|');
-
- var queryStrArr = [];
var queryStr = '';
hostNames.forEach(function (hostName) {
queryStr += 'Hosts/host_name=' + hostName + '|';
- if (queryStr.length > 3500) {
- queryStrArr.push(queryStr.slice(0, -1));
- queryStr = '';
- }
});
+ //slice off last symbol '|'
+ queryStr = queryStr.slice(0, -1);
- if (queryStr.length > 0) {
- queryStrArr.push(queryStr.slice(0, -1));
- }
-
- queryStrArr.forEach(function (queryStr) {
- // console.log('creating host components for ' + queryStr);
- var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/hosts?' + queryStr;
- var data = {
+ var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/hosts';
+ var data = {
+ "RequestInfo": {
+ "query": queryStr
+ },
+ "Body": {
"host_components": [
{
"HostRoles": {
@@ -1011,14 +999,14 @@ App.WizardStep8Controller = Em.Controller.extend({
}
}
]
- };
+ }
+ };
- this.ajax({
- type: 'POST',
- url: url,
- data: JSON.stringify(data)
- });
- }, this);
+ this.ajax({
+ type: 'POST',
+ url: url,
+ data: JSON.stringify(data)
+ });
},
createConfigurations: function () {