step8_controller.js 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. var stringUtils = require('utils/string_utils');
  20. App.WizardStep8Controller = Em.Controller.extend({
  21. name: 'wizardStep8Controller',
  22. rawContent: require('data/review_configs'),
  23. totalHosts: [],
  24. clusterInfo: [],
  25. services: [],
  26. configs: [],
  27. globals: [],
  28. ajaxQueue: [],
  29. configMapping: function(){
  30. return App.config.get('configMapping').all(true);
  31. }.property('App.config.configMapping'),
  32. slaveComponentConfig: null,
  33. isSubmitDisabled: false,
  34. isBackBtnDisabled: false,
  35. hasErrorOccurred: false,
  36. servicesInstalled: false,
  37. serviceConfigTags: [],
  38. securityEnabled: function() {
  39. return App.router.get('mainAdminSecurityController.securityEnabled');
  40. }.property('App.router.mainAdminSecurityController.securityEnabled'),
  41. /**
  42. * During page save time, we set the host overrides to the server.
  43. * The new host -> site:tag map is stored below. This will be
  44. * useful during save, to update the host's host components. Also,
  45. * it will be useful in deletion of overrides.
  46. *
  47. * Example:
  48. * {
  49. * 'hostname1': {
  50. * 'global': {
  51. * 'tagName': 'tag3187261938_hostname1',
  52. * 'map': {
  53. * 'hadoop_heapsize': '2048m'
  54. * }
  55. * }
  56. * }
  57. * }
  58. *
  59. * @see loadedHostToOverrideSiteToTagMap
  60. */
  61. savedHostToOverrideSiteToTagMap: {},
  62. selectedConfigGroup: null,
  63. configGroups: [],
  64. selectedServices: function () {
  65. return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
  66. }.property('content.services').cacheable(),
  67. clearStep: function () {
  68. this.get('services').clear();
  69. this.get('configs').clear();
  70. this.get('globals').clear();
  71. this.get('clusterInfo').clear();
  72. this.get('serviceConfigTags').clear();
  73. this.set('servicesInstalled', false);
  74. },
  75. loadStep: function () {
  76. console.log("TRACE: Loading step8: Review Page");
  77. if (this.get('content.controllerName') != 'installerController') {
  78. App.router.get('mainAdminSecurityController').setSecurityStatus();
  79. }
  80. this.clearStep();
  81. if (this.get('content.serviceConfigProperties')) {
  82. this.formatProperties();
  83. this.loadGlobals();
  84. this.loadConfigs();
  85. }
  86. this.loadClusterInfo();
  87. this.loadServices();
  88. this.set('isSubmitDisabled', false);
  89. this.set('isBackBtnDisabled', false);
  90. },
  91. /**
  92. * replace whitespace character with coma between directories
  93. */
  94. formatProperties: function(){
  95. this.get('content.serviceConfigProperties').forEach(function(_configProperty){
  96. _configProperty.value = App.config.trimProperty(_configProperty,false);
  97. });
  98. },
  99. loadGlobals: function () {
  100. var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
  101. if (globals.someProperty('name', 'hive_database')) {
  102. var hiveDb = globals.findProperty('name', 'hive_database');
  103. var hiveDbType = {name: 'hive_database_type', value: 'mysql'};
  104. var hiveJdbcDriver = {name: 'hive_jdbc_driver'};
  105. if (hiveDb.value === 'New MySQL Database') {
  106. if (globals.someProperty('name', 'hive_ambari_host')) {
  107. globals.findProperty('name', 'hive_hostname').value = globals.findProperty('name', 'hive_ambari_host').value;
  108. hiveDbType.value = 'mysql';
  109. hiveJdbcDriver.value = 'com.mysql.jdbc.Driver';
  110. }
  111. globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
  112. globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
  113. globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
  114. globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
  115. } else if (hiveDb.value === 'Existing MySQL Database'){
  116. globals.findProperty('name', 'hive_hostname').value = globals.findProperty('name', 'hive_existing_mysql_host').value;
  117. hiveDbType.value = 'mysql';
  118. hiveJdbcDriver.value = 'com.mysql.jdbc.Driver';
  119. globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
  120. globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
  121. globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
  122. globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_database'));
  123. } else { //existing oracle database
  124. globals.findProperty('name', 'hive_hostname').value = globals.findProperty('name', 'hive_existing_oracle_host').value;
  125. hiveDbType.value = 'oracle';
  126. hiveJdbcDriver.value = 'oracle.jdbc.driver.OracleDriver';
  127. globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
  128. globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
  129. globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
  130. globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
  131. }
  132. globals.push(hiveDbType);
  133. globals.push(hiveJdbcDriver);
  134. }
  135. if (globals.someProperty('name', 'oozie_database')) {
  136. var oozieDb = globals.findProperty('name', 'oozie_database');
  137. var oozieDbType = {name:'oozie_database_type'};
  138. var oozieJdbcDriver = {name: 'oozie_jdbc_driver'};
  139. if (oozieDb.value === 'New Derby Database') {
  140. globals.findProperty('name', 'oozie_hostname').value = globals.findProperty('name', 'oozie_ambari_host').value;
  141. oozieDbType.value = 'derby';
  142. oozieJdbcDriver.value = 'org.apache.derby.jdbc.EmbeddedDriver';
  143. globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
  144. globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
  145. globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
  146. globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
  147. globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
  148. globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
  149. } else if (oozieDb.value === 'Existing MySQL Database') {
  150. globals.findProperty('name', 'oozie_hostname').value = globals.findProperty('name', 'oozie_existing_mysql_host').value;
  151. oozieDbType.value = 'mysql';
  152. oozieJdbcDriver.value = 'com.mysql.jdbc.Driver';
  153. globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
  154. globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
  155. globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
  156. globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
  157. globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
  158. } else { // existing oracle database
  159. globals.findProperty('name', 'oozie_hostname').value = globals.findProperty('name', 'oozie_existing_oracle_host').value;
  160. oozieDbType.value = 'oracle';
  161. oozieJdbcDriver.value = 'oracle.jdbc.driver.OracleDriver';
  162. globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
  163. globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
  164. globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
  165. globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
  166. globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
  167. }
  168. globals.push(oozieDbType);
  169. globals.push(oozieJdbcDriver);
  170. }
  171. this.set('globals', globals);
  172. },
  173. loadConfigs: function () {
  174. //storedConfigs contains custom configs as well
  175. var serviceConfigProperties = this.get('content.serviceConfigProperties').filterProperty('id', 'site property');
  176. serviceConfigProperties.forEach(function(_config){
  177. _config.value = (typeof _config.value === "boolean") ? _config.value.toString() : _config.value;
  178. });
  179. var storedConfigs = serviceConfigProperties.filterProperty('value');
  180. var mappedConfigs = App.config.excludeUnsupportedConfigs(this.get('configMapping'), this.get('selectedServices').mapProperty('serviceName'));
  181. var uiConfigs = this.loadUiSideConfigs(mappedConfigs);
  182. this.set('configs', storedConfigs.concat(uiConfigs));
  183. },
  184. loadUiSideConfigs: function (configMapping) {
  185. var uiConfig = [];
  186. var configs = configMapping.filterProperty('foreignKey', null);
  187. this.addDynamicProperties(configs);
  188. configs.forEach(function (_config) {
  189. var valueWithOverrides = this.getGlobConfigValueWithOverrides(_config.templateName, _config.value, _config.name);
  190. uiConfig.pushObject({
  191. "id": "site property",
  192. "name": _config.name,
  193. "value": valueWithOverrides.value,
  194. "filename": _config.filename,
  195. "overrides": valueWithOverrides.overrides
  196. });
  197. }, this);
  198. var dependentConfig = $.extend(true, [], configMapping.filterProperty('foreignKey'));
  199. dependentConfig.forEach(function (_config) {
  200. App.config.setConfigValue(uiConfig, this.get('content.serviceConfigProperties'), _config, this.get('globals'));
  201. uiConfig.pushObject({
  202. "id": "site property",
  203. "name": _config._name || _config.name,
  204. "value": _config.value,
  205. "filename": _config.filename
  206. });
  207. }, this);
  208. return uiConfig;
  209. },
  210. addDynamicProperties: function(configs) {
  211. var templetonHiveProperty = this.get('content.serviceConfigProperties').someProperty('name', 'templeton.hive.properties');
  212. if (!templetonHiveProperty) {
  213. configs.pushObject({
  214. "name": "templeton.hive.properties",
  215. "templateName": ["hivemetastore_host"],
  216. "foreignKey": null,
  217. "value": "hive.metastore.local=false,hive.metastore.uris=thrift://<templateName[0]>:9083,hive.metastore.sasl.enabled=yes,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse",
  218. "filename": "webhcat-site.xml"
  219. });
  220. }
  221. },
  222. getRegisteredHosts: function () {
  223. var allHosts = this.get('content.hosts');
  224. var hosts = [];
  225. for (var hostName in allHosts) {
  226. if (allHosts[hostName].bootStatus == 'REGISTERED') {
  227. allHosts[hostName].hostName = allHosts[hostName].name;
  228. hosts.pushObject(allHosts[hostName]);
  229. }
  230. }
  231. return hosts;
  232. },
  233. /**
  234. * Set all site property that are derived from other puppet-variable
  235. * @param {String} templateName
  236. * @param {String} expression
  237. * @param {String} name
  238. * @return {Object}
  239. * example: <code>{
  240. * value: '...',
  241. * overrides: {
  242. * 'value1': [h1, h2],
  243. * 'value2': [h3]
  244. * }
  245. * }</code>
  246. */
  247. getGlobConfigValueWithOverrides: function (templateName, expression, name) {
  248. var express = expression.match(/<(.*?)>/g);
  249. var value = expression;
  250. if (express == null) {
  251. return { value : expression, overrides: []}; // if site property do not map any global property then return the value
  252. }
  253. var overrideHostToValue = {};
  254. express.forEach(function (_express) {
  255. //console.log("The value of template is: " + _express);
  256. var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
  257. if (this.get('globals').someProperty('name', templateName[index])) {
  258. //console.log("The name of the variable is: " + this.get('content.serviceConfigProperties').findProperty('name', templateName[index]).name);
  259. var globalObj = this.get('globals').findProperty('name', templateName[index]);
  260. var globValue = globalObj.value;
  261. // Hack for templeton.zookeeper.hosts
  262. var preReplaceValue = null;
  263. if (value !== null) { // if the property depends on more than one template name like <templateName[0]>/<templateName[1]> then don't proceed to the next if the prior is null or not found in the global configs
  264. preReplaceValue = value;
  265. value = this._replaceConfigValues(name, _express, value, globValue);
  266. }
  267. if(globalObj.overrides!=null){
  268. globalObj.overrides.forEach(function(override){
  269. var ov = override.value;
  270. var hostsArray = override.hosts;
  271. hostsArray.forEach(function(host){
  272. if(!(host in overrideHostToValue)){
  273. overrideHostToValue[host] = this._replaceConfigValues(name, _express, preReplaceValue, ov);
  274. }else{
  275. overrideHostToValue[host] = this._replaceConfigValues(name, _express, overrideHostToValue[host], ov);
  276. }
  277. }, this);
  278. }, this);
  279. }
  280. } else {
  281. /*
  282. console.log("ERROR: The variable name is: " + templateName[index]);
  283. console.log("ERROR: mapped config from configMapping file has no corresponding variable in " +
  284. "content.serviceConfigProperties. Two possible reasons for the error could be: 1) The service is not selected. " +
  285. "and/OR 2) The service_config metadata file has no corresponding global var for the site property variable");
  286. */
  287. value = null;
  288. }
  289. }, this);
  290. var valueWithOverrides = {
  291. value: value,
  292. overrides: []
  293. };
  294. var overrideValueToHostMap = {};
  295. if(!jQuery.isEmptyObject(overrideHostToValue)){
  296. for(var host in overrideHostToValue){
  297. var hostVal = overrideHostToValue[host];
  298. if(!(hostVal in overrideValueToHostMap)){
  299. overrideValueToHostMap[hostVal] = [];
  300. }
  301. overrideValueToHostMap[hostVal].push(host);
  302. }
  303. }
  304. for(var val in overrideValueToHostMap){
  305. valueWithOverrides.overrides.push({
  306. value: val,
  307. hosts: overrideValueToHostMap[val]
  308. });
  309. }
  310. return valueWithOverrides;
  311. },
  312. _replaceConfigValues: function (name, express, value, globValue) {
  313. return value.replace(express, globValue);
  314. },
  315. /**
  316. * Load all info about cluster to <code>clusterInfo</code> variable
  317. */
  318. loadClusterInfo: function () {
  319. //Admin name
  320. var admin = this.rawContent.findProperty('config_name', 'Admin');
  321. admin.config_value = App.db.getLoginName();
  322. console.log("STEP8: the value of content cluster name: " + App.db.getLoginName());
  323. if (admin.config_value) {
  324. this.get('clusterInfo').pushObject(Ember.Object.create(admin));
  325. }
  326. // cluster name
  327. var cluster = this.rawContent.findProperty('config_name', 'cluster');
  328. cluster.config_value = this.get('content.cluster.name');
  329. console.log("STEP8: the value of content cluster name: " + this.get('content.cluster.name'));
  330. this.get('clusterInfo').pushObject(Ember.Object.create(cluster));
  331. //hosts
  332. var masterHosts = this.get('content.masterComponentHosts').mapProperty('hostName').uniq();
  333. var slaveHosts = this.get('content.slaveComponentHosts');
  334. var hostObj = [];
  335. slaveHosts.forEach(function (_hosts) {
  336. hostObj = hostObj.concat(_hosts.hosts);
  337. }, this);
  338. slaveHosts = hostObj.mapProperty('hostName').uniq();
  339. var componentHosts = masterHosts.concat(slaveHosts).uniq();
  340. var totalHosts = App.Host.find().mapProperty('hostName').concat(componentHosts).uniq();
  341. var newHostsCount = totalHosts.length - App.Host.find().content.length;
  342. this.set('totalHosts', totalHosts);
  343. var totalHostsObj = this.rawContent.findProperty('config_name', 'hosts');
  344. totalHostsObj.config_value = totalHosts.length + ' (' + newHostsCount + ' new)';
  345. this.get('clusterInfo').pushObject(Ember.Object.create(totalHostsObj));
  346. //repo
  347. if (['addHostController', 'addServiceController'].contains(this.get('content.controllerName'))) {
  348. this.loadRepoInfo();
  349. } else { // from install wizard
  350. var selectedStack = this.get('content.stacks').findProperty('isSelected', true);
  351. var allRepos = [];
  352. var supportedOs = ['redhat5', 'redhat6', 'sles11'];
  353. if (selectedStack && selectedStack.operatingSystems) {
  354. selectedStack.operatingSystems.forEach(function (os) {
  355. if (os.selected && supportedOs.contains(os.osType)) {
  356. allRepos.push(Em.Object.create({
  357. base_url: os.baseUrl,
  358. os_type: Em.I18n.t("installer.step8.repoInfo.osType." + os.osType)
  359. }));
  360. }
  361. }, this);
  362. }
  363. allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
  364. this.get('clusterInfo').set('repoInfo', allRepos);
  365. }
  366. },
  367. /**
  368. * get the repositories info of HDP from server. Used only in addHost controller.
  369. */
  370. loadRepoInfo: function(){
  371. var nameVersionCombo = App.get('currentStackVersion');
  372. var stackName = nameVersionCombo.split('-')[0];
  373. var stackVersion = nameVersionCombo.split('-')[1];
  374. App.ajax.send({
  375. name: 'cluster.load_repositories',
  376. sender: this,
  377. data: {
  378. stackName: stackName,
  379. stackVersion: stackVersion
  380. },
  381. success: 'loadRepoInfoSuccessCallback',
  382. error: 'loadRepositoriesErrorCallback'
  383. });
  384. },
  385. loadRepoInfoSuccessCallback: function (data) {
  386. var allRepos = [];
  387. var supportedOs = ['redhat5', 'redhat6', 'sles11'];
  388. data.items.forEach(function (item) {
  389. var os = item.repositories[0].Repositories;
  390. if (supportedOs.contains(os.os_type)) {
  391. allRepos.push(Em.Object.create({
  392. base_url: os.base_url,
  393. os_type: Em.I18n.t("installer.step8.repoInfo.osType." + os.os_type)
  394. }));
  395. }
  396. }, this);
  397. allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
  398. this.get('clusterInfo').set('repoInfo', allRepos);
  399. },
  400. loadRepoInfoErrorCallback: function(request, ajaxOptions, error) {
  401. console.log('Error message is: ' + request.responseText);
  402. var allRepos = [];
  403. allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
  404. this.get('clusterInfo').set('repoInfo', allRepos);
  405. },
  406. /**
  407. * Load all info about services to <code>services</code> variable
  408. */
  409. loadServices: function () {
  410. var reviewService = this.rawContent.findProperty('config_name', 'services');
  411. this.get('selectedServices').forEach(function (_service) {
  412. console.log('INFO: step8: Name of the service from getService function: ' + _service.serviceName);
  413. var serviceObj = reviewService.config_value.findProperty('service_name', _service.serviceName);
  414. if (serviceObj) {
  415. serviceObj.get('service_components').forEach(function (_component) {
  416. this.assignComponentHosts(_component);
  417. }, this);
  418. this.get('services').pushObject(serviceObj);
  419. }
  420. }, this);
  421. },
  422. assignComponentHosts: function (component) {
  423. var componentValue;
  424. if (component.get('customHandler')) {
  425. this[component.get('customHandler')].call(this, component);
  426. } else {
  427. if (component.get('isMaster')) {
  428. componentValue = this.get('content.masterComponentHosts')
  429. .findProperty('component', component.component_name).hostName;
  430. } else {
  431. var hostsLength = this.get('content.slaveComponentHosts')
  432. .findProperty('componentName', component.component_name)
  433. .hosts.length;
  434. componentValue = hostsLength + Em.I18n.t('installer.step8.host' + ((hostsLength > 1) ? 's' : ''));
  435. }
  436. component.set('component_value', componentValue);
  437. }
  438. },
  439. loadHiveDbValue: function (dbComponent) {
  440. var hiveDb = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'hive_database');
  441. if (hiveDb.value === 'New MySQL Database') {
  442. dbComponent.set('component_value', 'MySQL (New Database)');
  443. } else if(hiveDb.value === 'Existing MySQL Database'){
  444. var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'hive_existing_mysql_database');
  445. dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
  446. } else { // existing oracle database
  447. var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'hive_existing_oracle_database');
  448. dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
  449. }
  450. },
  451. loadHbaseMasterValue: function (hbaseMaster) {
  452. var hbaseHostName = this.get('content.masterComponentHosts').filterProperty('component', hbaseMaster.component_name);
  453. if (hbaseHostName.length == 1) {
  454. hbaseMaster.set('component_value', hbaseHostName[0].hostName);
  455. } else {
  456. hbaseMaster.set('component_value', hbaseHostName[0].hostName + Em.I18n.t('installer.step8.other').format(hbaseHostName.length - 1));
  457. }
  458. },
  459. loadZkServerValue: function (serverComponent) {
  460. var zkHostNames = this.get('content.masterComponentHosts').filterProperty('component', serverComponent.component_name).length;
  461. var hostSuffix;
  462. if (zkHostNames === 1) {
  463. hostSuffix = Em.I18n.t('installer.step8.host');
  464. } else {
  465. hostSuffix = Em.I18n.t('installer.step8.hosts');
  466. }
  467. serverComponent.set('component_value', zkHostNames + ' ' + hostSuffix);
  468. },
  469. loadOozieDbValue: function (dbComponent) {
  470. var oozieDb = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_database');
  471. if (oozieDb.value === 'New Derby Database'){
  472. var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_derby_database');
  473. dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
  474. }/* else if (oozieDb.value === 'New MySQL Database') {
  475. dbComponent.set('component_value', 'MySQL (New Database)');
  476. } */else if(oozieDb.value === 'Existing MySQL Database'){
  477. var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_mysql_database');
  478. dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
  479. } else { // existing oracle database
  480. var db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_oracle_database');
  481. dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
  482. }
  483. },
  484. loadNagiosAdminValue: function (nagiosAdmin) {
  485. var config = this.get('content.serviceConfigProperties');
  486. var adminLoginName = config.findProperty('name', 'nagios_web_login');
  487. var adminEmail = config.findProperty('name', 'nagios_contact');
  488. nagiosAdmin.set('component_value', adminLoginName.value + ' / (' + adminEmail.value + ')');
  489. },
  490. /**
  491. * Onclick handler for <code>next</code> button
  492. */
  493. submit: function () {
  494. if (this.get('isSubmitDisabled')) {
  495. return;
  496. }
  497. if ((this.get('content.controllerName') == 'addHostController') && this.get('securityEnabled')) {
  498. var self = this;
  499. App.showConfirmationPopup(function() {
  500. self.submitProceed();
  501. }, Em.I18n.t('installer.step8.securityConfirmationPopupBody'));
  502. }
  503. else {
  504. this.submitProceed();
  505. }
  506. },
  507. /**
  508. * Update configurations for installed services.
  509. *
  510. * @param {Array} configsToUpdate - configs need to update
  511. * @return {*}
  512. */
  513. updateConfigurations: function (configsToUpdate) {
  514. var configurationController = App.router.get('mainServiceInfoConfigsController');
  515. var serviceNames = configsToUpdate.mapProperty('serviceName').uniq();
  516. serviceNames.forEach(function(serviceName) {
  517. var configs = configsToUpdate.filterProperty('serviceName', serviceName);
  518. configurationController.setNewTagNames(configs);
  519. var tagName = configs.objectAt(0).newTagName;
  520. var siteConfigs = configs.filterProperty('id', 'site property');
  521. siteConfigs.mapProperty('filename').uniq().forEach(function(siteName) {
  522. var formattedConfigs = configurationController.createSiteObj(siteName.replace(".xml", ""), tagName, configs.filterProperty('filename', siteName));
  523. configurationController.doPUTClusterConfigurationSite(formattedConfigs);
  524. });
  525. });
  526. },
  527. submitProceed: function() {
  528. this.set('isSubmitDisabled', true);
  529. this.set('isBackBtnDisabled', true);
  530. if (this.get('content.controllerName') == 'addHostController') {
  531. App.router.get('addHostController').setLowerStepsDisable(4);
  532. }
  533. // checkpoint the cluster status on the server so that the user can resume from where they left off
  534. switch (this.get('content.controllerName')) {
  535. case 'installerController':
  536. App.clusterStatus.setClusterStatus({
  537. clusterName: this.get('clusterName'),
  538. clusterState: 'CLUSTER_DEPLOY_PREP_2',
  539. wizardControllerName: this.get('content.controllerName'),
  540. localdb: App.db.data
  541. });
  542. break;
  543. case 'addHostController':
  544. App.clusterStatus.setClusterStatus({
  545. clusterName: this.get('clusterName'),
  546. clusterState: 'ADD_HOSTS_DEPLOY_PREP_2',
  547. wizardControllerName: this.get('content.controllerName'),
  548. localdb: App.db.data
  549. });
  550. break;
  551. case 'addServiceController':
  552. App.clusterStatus.setClusterStatus({
  553. clusterName: this.get('clusterName'),
  554. clusterState: 'ADD_SERVICES_DEPLOY_PREP_2',
  555. wizardControllerName: this.get('content.controllerName'),
  556. localdb: App.db.data
  557. });
  558. break;
  559. default:
  560. break;
  561. }
  562. // delete any existing clusters to start from a clean slate
  563. // before creating a new cluster in install wizard
  564. // TODO: modify for multi-cluster support
  565. if (this.get('content.controllerName') == 'installerController' && (!App.testMode)) {
  566. var clusterNames = this.getExistingClusterNames();
  567. this.deleteClusters(clusterNames);
  568. }
  569. if (this.get('wizardController').getDBProperty('configsToUpdate')) {
  570. this.updateConfigurations(this.get('wizardController').getDBProperty('configsToUpdate'));
  571. }
  572. this.setLocalRepositories();
  573. this.createCluster();
  574. this.createSelectedServices();
  575. this.createConfigurations();
  576. this.createComponents();
  577. this.registerHostsToCluster();
  578. if (App.supports.hostOverridesInstaller) {
  579. this.createConfigurationGroups();
  580. }
  581. this.createAllHostComponents();
  582. this.ajaxQueueFinished = function () {
  583. console.log('everything is loaded');
  584. App.router.send('next');
  585. };
  586. this.doNextAjaxCall();
  587. },
  588. /**
  589. * Used in progress bar
  590. */
  591. ajaxQueueLength: function () {
  592. return this.get('ajaxQueue').length;
  593. }.property('ajaxQueue.length'),
  594. /**
  595. * Used in progress bar
  596. */
  597. ajaxQueueLeft: 0,
  598. setAmbariUIDb: function () {
  599. var dbContent = this.get('content.slaveGroupProperties');
  600. var slaveComponentConfig = this.get("slaveComponentConfig");
  601. this.persistKeyValues(slaveComponentConfig.version, dbContent);
  602. this.persistKeyValues('current_version', slaveComponentConfig.version);
  603. },
  604. persistKeyValues: function (key, value) {
  605. var str = "{ '" + key + "' : '" + JSON.stringify(value) + "'}";
  606. var obj = eval("(" + str + ")");
  607. this.ajax({
  608. type: "POST",
  609. url: App.apiPrefix + '/persist',
  610. data: JSON.stringify(obj),
  611. beforeSend: function () {
  612. console.log('BeforeSend: persistKeyValues', obj);
  613. }
  614. });
  615. },
  616. clusterName: function () {
  617. return this.get('content.cluster.name');
  618. }.property('content.cluster.name'),
  619. clusterNames: [],
  620. // returns an array of existing cluster names.
  621. // returns an empty array if there are no existing clusters.
  622. getExistingClusterNames: function () {
  623. var url = App.apiPrefix + '/clusters';
  624. App.ajax.send({
  625. name: 'wizard.step8.existing_cluster_names',
  626. sender: this,
  627. success: 'getExistingClusterNamesSuccessCallBack',
  628. error: 'getExistingClusterNamesErrorCallback'
  629. });
  630. return this.get('clusterNames');
  631. },
  632. getExistingClusterNamesSuccessCallBack: function (data) {
  633. var clusterNames = data.items.mapProperty('Clusters.cluster_name');
  634. console.log("Got existing cluster names: " + clusterNames);
  635. this.set('clusterNames', clusterNames);
  636. },
  637. getExistingClusterNamesErrorCallback: function () {
  638. console.log("Failed to get existing cluster names");
  639. this.set('clusterNames', []);
  640. },
  641. deleteClusters: function (clusterNames) {
  642. clusterNames.forEach(function (clusterName) {
  643. App.ajax.send({
  644. name: 'wizard.step8.delete_cluster',
  645. sender: this,
  646. data: {
  647. name: clusterName
  648. },
  649. success: 'deleteClustersSuccessCallback',
  650. error: 'deleteClustersErrorCallback'
  651. });
  652. }, this);
  653. },
  654. deleteClustersSuccessCallback: function(data, opt, params) {
  655. console.log('DELETE cluster ' + params.name + ' succeeded');
  656. },
  657. deleteClustersErrorCallback: function(request, ajaxOptions, error, opt) {
  658. console.log('DELETE cluster failed');
  659. },
  660. /**
  661. * Updates local repositories for the Ambari server.
  662. */
  663. setLocalRepositories: function () {
  664. if (this.get('content.controllerName') !== 'installerController' || !App.supports.localRepositories) {
  665. return false;
  666. }
  667. var self = this;
  668. var apiUrl = App.get('stack2VersionURL');
  669. var stacks = this.get('content.stacks');
  670. stacks.forEach(function (stack) {
  671. stack.operatingSystems.forEach(function (os) {
  672. if (os.baseUrl !== os.originalBaseUrl) {
  673. console.log("Updating local repository URL from " + os.originalBaseUrl + " -> " + os.baseUrl + ". ", os);
  674. var url = App.apiPrefix + apiUrl + "/operatingSystems/" + os.osType + "/repositories/" + stack.name;
  675. self.ajax({
  676. type: 'PUT',
  677. url: url,
  678. data: JSON.stringify({
  679. "Repositories": {
  680. "base_url": os.baseUrl
  681. }
  682. }),
  683. beforeSend: function () {
  684. console.log("BeforeSend: setLocalRepositories PUT to ", url);
  685. }
  686. });
  687. }
  688. });
  689. });
  690. },
  691. /**
  692. * The following create* functions are called upon submitting Step 8.
  693. */
  694. createCluster: function () {
  695. if (this.get('content.controllerName') !== 'installerController') {
  696. return false;
  697. }
  698. var clusterName = this.get('clusterName');
  699. var url = App.apiPrefix + '/clusters/' + clusterName;
  700. var stackVersion = (this.get('content.installOptions.localRepo')) ? App.currentStackVersion.replace(/(-\d+(\.\d)*)/ig, "Local$&") : App.currentStackVersion;
  701. this.ajax({
  702. type: 'POST',
  703. url: url,
  704. data: JSON.stringify({ "Clusters": {"version": stackVersion }}),
  705. beforeSend: function () {
  706. console.log("BeforeSend: createCluster for " + clusterName);
  707. }
  708. });
  709. },
  710. createSelectedServices: function () {
  711. var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services';
  712. var data = this.createServiceData();
  713. var httpMethod = 'POST';
  714. if (!data.length) {
  715. return;
  716. }
  717. this.ajax({
  718. type: httpMethod,
  719. url: url,
  720. data: JSON.stringify(data),
  721. beforeSend: function () {
  722. console.log('BeforeSend: createSelectedServices ', data);
  723. }
  724. });
  725. },
  726. createServiceData: function () {
  727. var services = this.get('selectedServices').mapProperty('serviceName');
  728. var data = [];
  729. services.forEach(function (_service) {
  730. data.pushObject({"ServiceInfo": { "service_name": _service }});
  731. }, this);
  732. return data;
  733. },
  734. createComponents: function () {
  735. var serviceComponents = require('data/service_components');
  736. var services = this.get('selectedServices').mapProperty('serviceName');
  737. services.forEach(function (_service) {
  738. var components = serviceComponents.filterProperty('service_name', _service);
  739. var componentsData = components.map(function (_component) {
  740. return { "ServiceComponentInfo": { "component_name": _component.component_name } };
  741. });
  742. // Service must be specified in terms of a query for creating multiple components at the same time.
  743. // See AMBARI-1018.
  744. var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services?ServiceInfo/service_name=' + _service;
  745. var data = {
  746. "components": componentsData
  747. };
  748. this.ajax({
  749. type: 'POST',
  750. url: url,
  751. data: JSON.stringify(data),
  752. beforeSend: function () {
  753. console.log('BeforeSend: createComponents for ' + _service, componentsData);
  754. }
  755. });
  756. }, this);
  757. },
  758. registerHostsToCluster: function () {
  759. var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/hosts';
  760. var data = this.createRegisterHostData();
  761. if (data.length == 0) {
  762. return;
  763. }
  764. this.ajax({
  765. type: 'POST',
  766. url: url,
  767. data: JSON.stringify(data),
  768. beforeSend: function () {
  769. console.log('BeforeSend: registerHostsToCluster', data);
  770. }
  771. });
  772. },
  773. createRegisterHostData: function () {
  774. var hosts = this.getRegisteredHosts().filterProperty('isInstalled', false);
  775. if (!hosts.length) {
  776. return [];
  777. }
  778. return hosts.map(function (host) {
  779. return {"Hosts": { "host_name": host.hostName}};
  780. });
  781. },
  782. // TODO: review the code for add hosts / add services scenarios...
  783. createAllHostComponents: function () {
  784. var masterHosts = this.get('content.masterComponentHosts');
  785. var slaveHosts = this.get('content.slaveComponentHosts');
  786. var clients = this.get('content.clients');
  787. // note: masterHosts has 'component' vs slaveHosts has 'componentName'
  788. var masterComponents = masterHosts.mapProperty('component').uniq();
  789. masterComponents.forEach(function (component) {
  790. var hostNames = masterHosts.filterProperty('component', component).filterProperty('isInstalled', false).mapProperty('hostName');
  791. this.registerHostsToComponent(hostNames, component);
  792. }, this);
  793. slaveHosts.forEach(function (_slave) {
  794. if (_slave.componentName !== 'CLIENT') {
  795. var hostNames = _slave.hosts.filterProperty('isInstalled', false).mapProperty('hostName');
  796. this.registerHostsToComponent(hostNames, _slave.componentName);
  797. } else {
  798. clients.forEach(function (_client) {
  799. var hostNames = _slave.hosts.mapProperty('hostName');
  800. switch (_client.component_name) {
  801. case 'HDFS_CLIENT':
  802. // install HDFS_CLIENT on HBASE_MASTER, HBASE_REGIONSERVER, WEBHCAT_SERVER, HISTORYSERVER and OOZIE_SERVER hosts
  803. masterHosts.filterProperty('component', 'HBASE_MASTER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  804. hostNames.pushObject(_masterHost.hostName);
  805. }, this);
  806. masterHosts.filterProperty('component', 'HBASE_REGIONSERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  807. hostNames.pushObject(_masterHost.hostName);
  808. }, this);
  809. masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  810. hostNames.pushObject(_masterHost.hostName);
  811. }, this);
  812. masterHosts.filterProperty('component', 'HISTORYSERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  813. hostNames.pushObject(_masterHost.hostName);
  814. }, this);
  815. masterHosts.filterProperty('component', 'OOZIE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  816. hostNames.pushObject(_masterHost.hostName);
  817. }, this);
  818. break;
  819. case 'MAPREDUCE_CLIENT':
  820. // install MAPREDUCE_CLIENT on HIVE_SERVER, OOZIE_SERVER, NAGIOS_SERVER, and WEBHCAT_SERVER hosts
  821. masterHosts.filterProperty('component', 'HIVE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  822. hostNames.pushObject(_masterHost.hostName);
  823. }, this);
  824. masterHosts.filterProperty('component', 'OOZIE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  825. hostNames.pushObject(_masterHost.hostName);
  826. }, this);
  827. masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  828. hostNames.pushObject(_masterHost.hostName);
  829. }, this);
  830. masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  831. hostNames.pushObject(_masterHost.hostName);
  832. }, this);
  833. break;
  834. case 'OOZIE_CLIENT':
  835. // install OOZIE_CLIENT on NAGIOS_SERVER host
  836. masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  837. hostNames.pushObject(_masterHost.hostName);
  838. }, this);
  839. break;
  840. case 'ZOOKEEPER_CLIENT':
  841. // install ZOOKEEPER_CLIENT on WEBHCAT_SERVER host
  842. masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  843. hostNames.pushObject(_masterHost.hostName);
  844. }, this);
  845. break;
  846. case 'HIVE_CLIENT':
  847. //install HIVE client on NAGIOS_SERVER host
  848. masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  849. hostNames.pushObject(_masterHost.hostName);
  850. }, this);
  851. masterHosts.filterProperty('component', 'HIVE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  852. hostNames.pushObject(_masterHost.hostName);
  853. }, this);
  854. break;
  855. case 'HCAT':
  856. // install HCAT (client) on NAGIOS_SERVER host
  857. masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  858. hostNames.pushObject(_masterHost.hostName);
  859. }, this);
  860. break;
  861. case 'YARN_CLIENT':
  862. // install YARN_CLIENT on NAGIOS_SERVER,HIVE_SERVER,OOZIE_SERVER,WEBHCAT_SERVER host
  863. masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  864. hostNames.pushObject(_masterHost.hostName);
  865. }, this);
  866. masterHosts.filterProperty('component', 'HIVE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  867. hostNames.pushObject(_masterHost.hostName);
  868. }, this);
  869. masterHosts.filterProperty('component', 'OOZIE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  870. hostNames.pushObject(_masterHost.hostName);
  871. }, this);
  872. masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  873. hostNames.pushObject(_masterHost.hostName);
  874. }, this);
  875. break;
  876. case 'TEZ_CLIENT':
  877. //install TEZ client on HIVE_SERVER, HIVE_CLIENT hosts.
  878. //HIVE_CLIENT always installed on NAGIOS_SERVER host, so it is the same host with NAGIOS_SERVER and HIVE_CLIENT
  879. masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  880. hostNames.pushObject(_masterHost.hostName);
  881. }, this);
  882. masterHosts.filterProperty('component', 'HIVE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
  883. hostNames.pushObject(_masterHost.hostName);
  884. }, this);
  885. break;
  886. }
  887. hostNames = hostNames.uniq();
  888. if (_client.isInstalled) {
  889. //check whether clients are already installed on selected master hosts!!!
  890. var installedHosts = _slave.hosts.filterProperty('isInstalled', true).mapProperty('hostName');
  891. installedHosts.forEach(function (host) {
  892. if (hostNames.contains(host)) {
  893. hostNames.splice(hostNames.indexOf(host), 1);
  894. }
  895. }, this);
  896. }
  897. this.registerHostsToComponent(hostNames, _client.component_name);
  898. }, this);
  899. }
  900. }, this);
  901. // add Ganglia Monitor (Slave) to all hosts if Ganglia service is selected
  902. var gangliaService = this.get('content.services').filterProperty('isSelected', true).findProperty('serviceName', 'GANGLIA');
  903. if (gangliaService) {
  904. var hosts = this.getRegisteredHosts();
  905. if (gangliaService.get('isInstalled')) {
  906. hosts = hosts.filterProperty('isInstalled', false);
  907. }
  908. if (hosts.length) {
  909. this.registerHostsToComponent(hosts.mapProperty('hostName'), 'GANGLIA_MONITOR');
  910. }
  911. }
  912. // add MySQL Server if Hive is selected
  913. var hiveService = this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false).findProperty('serviceName', 'HIVE');
  914. if (hiveService) {
  915. var hiveDb = this.get('content.serviceConfigProperties').findProperty('name', 'hive_database');
  916. if(hiveDb.value == "New MySQL Database") {
  917. this.registerHostsToComponent(masterHosts.filterProperty('component', 'HIVE_SERVER').mapProperty('hostName'), 'MYSQL_SERVER');
  918. }
  919. }
  920. },
  921. registerHostsToComponent: function (hostNames, componentName) {
  922. if (hostNames.length == 0) {
  923. return;
  924. }
  925. var queryStr = '';
  926. hostNames.forEach(function (hostName) {
  927. queryStr += 'Hosts/host_name=' + hostName + '|';
  928. });
  929. //slice off last symbol '|'
  930. queryStr = queryStr.slice(0, -1);
  931. var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/hosts';
  932. var data = {
  933. "RequestInfo": {
  934. "query": queryStr
  935. },
  936. "Body": {
  937. "host_components": [
  938. {
  939. "HostRoles": {
  940. "component_name": componentName
  941. }
  942. }
  943. ]
  944. }
  945. };
  946. this.ajax({
  947. type: 'POST',
  948. url: url,
  949. data: JSON.stringify(data)
  950. });
  951. },
  952. createConfigurations: function () {
  953. var selectedServices = this.get('selectedServices');
  954. var coreSiteObject = this.createCoreSiteObj();
  955. if (this.get('content.controllerName') == 'installerController') {
  956. this.get('serviceConfigTags').pushObject(coreSiteObject);
  957. this.get('serviceConfigTags').pushObject(this.createHdfsSiteObj());
  958. this.get('serviceConfigTags').pushObject(this.createLog4jObj('HDFS'));
  959. }
  960. var globalSiteObj = this.createGlobalSiteObj();
  961. if (['addHostController','addServiceController'].contains(this.get('content.controllerName'))) {
  962. globalSiteObj.tag = 'version' + (new Date).getTime();
  963. coreSiteObject.tag = 'version' + (new Date).getTime();
  964. this.get('serviceConfigTags').pushObject(coreSiteObject);
  965. }
  966. this.get('serviceConfigTags').pushObject(globalSiteObj);
  967. if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
  968. this.get('serviceConfigTags').pushObject(this.createMrSiteObj());
  969. if (App.supports.capacitySchedulerUi) {
  970. this.get('serviceConfigTags').pushObject(this.createCapacityScheduler());
  971. this.get('serviceConfigTags').pushObject(this.createMapredQueueAcls());
  972. }
  973. this.get('serviceConfigTags').pushObject(this.createLog4jObj('MAPREDUCE'));
  974. }
  975. if (selectedServices.someProperty('serviceName', 'MAPREDUCE2')) {
  976. this.get('serviceConfigTags').pushObject(this.createMrSiteObj());
  977. this.get('serviceConfigTags').pushObject(this.createLog4jObj('MAPREDUCE2'));
  978. }
  979. if (selectedServices.someProperty('serviceName', 'YARN')) {
  980. this.get('serviceConfigTags').pushObject(this.createYarnSiteObj());
  981. this.get('serviceConfigTags').pushObject(this.createCapacityScheduler());
  982. this.get('serviceConfigTags').pushObject(this.createLog4jObj('YARN'));
  983. }
  984. if (selectedServices.someProperty('serviceName', 'HBASE')) {
  985. this.get('serviceConfigTags').pushObject(this.createHbaseSiteObj());
  986. this.get('serviceConfigTags').pushObject(this.createLog4jObj('HBASE'));
  987. }
  988. if (selectedServices.someProperty('serviceName', 'OOZIE')) {
  989. this.get('serviceConfigTags').pushObject(this.createOozieSiteObj());
  990. this.get('serviceConfigTags').pushObject(this.createLog4jObj('OOZIE'));
  991. }
  992. if (selectedServices.someProperty('serviceName', 'HIVE')) {
  993. this.get('serviceConfigTags').pushObject(this.createHiveSiteObj());
  994. this.get('serviceConfigTags').pushObject(this.createLog4jObj('HIVE'));
  995. this.get('serviceConfigTags').pushObject(this.createLog4jObj('HIVE-EXEC'));
  996. }
  997. if (selectedServices.someProperty('serviceName', 'WEBHCAT')) {
  998. this.get('serviceConfigTags').pushObject(this.createWebHCatSiteObj());
  999. }
  1000. if (selectedServices.someProperty('serviceName', 'HUE')) {
  1001. this.get('serviceConfigTags').pushObject(this.createHueSiteObj());
  1002. }
  1003. if (selectedServices.someProperty('serviceName', 'PIG')) {
  1004. this.get('serviceConfigTags').pushObject(this.createLog4jObj('PIG'));
  1005. }
  1006. if (selectedServices.someProperty('serviceName', 'FALCON')) {
  1007. this.get('serviceConfigTags').pushObject(this.createFalconStartupSiteObj());
  1008. this.get('serviceConfigTags').pushObject(this.createFalconRuntimeSiteObj());
  1009. }
  1010. if (selectedServices.someProperty('serviceName', 'STORM')) {
  1011. this.get('serviceConfigTags').pushObject(this.createStormSiteObj());
  1012. }
  1013. if (selectedServices.someProperty('serviceName', 'TEZ')) {
  1014. this.get('serviceConfigTags').pushObject(this.createTezSiteObj());
  1015. }
  1016. if (selectedServices.someProperty('serviceName', 'ZOOKEEPER')) {
  1017. this.get('serviceConfigTags').pushObject(this.createZooCfgObj());
  1018. this.get('serviceConfigTags').pushObject(this.createLog4jObj('ZOOKEEPER'));
  1019. }
  1020. this.applyConfigurationsToCluster();
  1021. },
  1022. applyConfigurationsToCluster: function() {
  1023. var clusterUrl = App.apiPrefix + '/clusters/' + this.get('clusterName');
  1024. var configData = [];
  1025. this.get('serviceConfigTags').forEach(function (_serviceConfig) {
  1026. var Clusters = {
  1027. Clusters: {
  1028. desired_config: {
  1029. type: _serviceConfig.type,
  1030. tag: _serviceConfig.tag,
  1031. properties: _serviceConfig.properties
  1032. }
  1033. }
  1034. };
  1035. configData.pushObject(JSON.stringify(Clusters));
  1036. }, this);
  1037. var data = {
  1038. configData: '[' + configData.toString() + ']'
  1039. };
  1040. console.debug("applyConfigurationsToCluster(Step8): Applying to URL", clusterUrl, " Data:", data.configData);
  1041. this.ajax({
  1042. type: 'PUT',
  1043. url: clusterUrl,
  1044. data: data.configData,
  1045. beforeSend: function () {
  1046. console.log("BeforeSend: Updating cluster config");
  1047. }
  1048. });
  1049. },
  1050. createConfigurationGroups: function () {
  1051. var configGroups = this.get('content.configGroups').filterProperty('isDefault', false);
  1052. var clusterName = this.get('clusterName');
  1053. var sendData = [];
  1054. var updateData = [];
  1055. var serviceConfigController = App.router.get('mainServiceInfoConfigsController');
  1056. var timeTag = (new Date).getTime();
  1057. var groupsToDelete = App.router.get(this.get('content.controllerName')).getDBProperty('groupsToDelete');
  1058. if (groupsToDelete && groupsToDelete.length > 0) {
  1059. this.removeInstalledServicesConfigurationGroups(groupsToDelete);
  1060. }
  1061. configGroups.forEach(function (configGroup) {
  1062. var groupConfigs = [];
  1063. var groupData = {
  1064. "cluster_name": clusterName,
  1065. "group_name": configGroup.name,
  1066. "tag": configGroup.service.id,
  1067. "description": configGroup.description,
  1068. "hosts": [],
  1069. "desired_configs": []
  1070. };
  1071. configGroup.hosts.forEach(function (hostName) {
  1072. groupData.hosts.push({"host_name": hostName});
  1073. });
  1074. //wrap properties into Em.Object to make them compatible with buildGroupDesiredConfigs method
  1075. configGroup.properties.forEach(function (property) {
  1076. groupConfigs.push(Em.Object.create(property));
  1077. });
  1078. groupData.desired_configs = serviceConfigController.buildGroupDesiredConfigs.call(serviceConfigController, groupConfigs, timeTag);
  1079. // check for group from installed service
  1080. if (configGroup.isForUpdate === true) {
  1081. // if group is a new one, create it
  1082. if (!configGroup.id) {
  1083. sendData.push({"ConfigGroup": groupData});
  1084. } else {
  1085. // update an existing group
  1086. groupData.id = configGroup.id;
  1087. updateData.push({"ConfigGroup": groupData});
  1088. }
  1089. } else {
  1090. sendData.push({"ConfigGroup": groupData});
  1091. }
  1092. //each group should have unique tag to prevent overriding configs from common sites
  1093. timeTag++;
  1094. }, this);
  1095. if (sendData.length > 0) {
  1096. this.applyConfigurationGroups(sendData);
  1097. }
  1098. if (updateData.length > 0) {
  1099. this.applyInstalledServicesConfigurationGroup(updateData);
  1100. }
  1101. },
  1102. applyConfigurationGroups: function (sendData) {
  1103. var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/config_groups';
  1104. this.ajax({
  1105. type: 'POST',
  1106. url: url,
  1107. data: JSON.stringify(sendData)
  1108. });
  1109. },
  1110. applyInstalledServicesConfigurationGroup: function (updateData) {
  1111. updateData.forEach(function(item) {
  1112. App.router.get('mainServiceInfoConfigsController').putConfigGroupChanges(item);
  1113. });
  1114. },
  1115. removeInstalledServicesConfigurationGroups: function(groupsToDelete) {
  1116. groupsToDelete.forEach(function(item) {
  1117. App.config.deleteConfigGroup(Em.Object.create(item));
  1118. });
  1119. },
  1120. createGlobalSiteObj: function () {
  1121. var globalSiteProperties = {};
  1122. var globalSiteObj = this.get('globals');
  1123. var isGLUSTERFSSelected = this.get('selectedServices').someProperty('serviceName', 'GLUSTERFS');
  1124. // screen out the GLUSTERFS-specific global config entries when they are not required
  1125. if (!isGLUSTERFSSelected) {
  1126. globalSiteObj = globalSiteObj.filter(function(_config) {
  1127. return _config.name.indexOf("fs_glusterfs") < 0;
  1128. });
  1129. }
  1130. globalSiteObj.forEach(function (_globalSiteObj) {
  1131. var heapsizeException = ['hadoop_heapsize','yarn_heapsize','nodemanager_heapsize','resourcemanager_heapsize', 'apptimelineserver_heapsize'];
  1132. // do not pass any globals whose name ends with _host or _hosts
  1133. if (_globalSiteObj.isRequiredByAgent !== false) {
  1134. // append "m" to JVM memory options except for hadoop_heapsize
  1135. if (/_heapsize|_newsize|_maxnewsize$/.test(_globalSiteObj.name) && !heapsizeException.contains(_globalSiteObj.name)) {
  1136. globalSiteProperties[_globalSiteObj.name] = _globalSiteObj.value + "m";
  1137. } else {
  1138. globalSiteProperties[_globalSiteObj.name] = App.config.escapeXMLCharacters(_globalSiteObj.value);
  1139. }
  1140. }
  1141. }, this);
  1142. // we don't expose gmond_user to the user; it needs to be the same as gmetad_user
  1143. globalSiteProperties['gmond_user'] = globalSiteProperties['gmetad_user'];
  1144. return {"type": "global", "tag": "version1", "properties": globalSiteProperties};
  1145. },
  1146. createCoreSiteObj: function () {
  1147. var coreSiteObj = this.get('configs').filterProperty('filename', 'core-site.xml');
  1148. var coreSiteProperties = {};
  1149. // hadoop.proxyuser.oozie.hosts needs to be skipped if oozie is not selected
  1150. var isOozieSelected = this.get('selectedServices').someProperty('serviceName', 'OOZIE');
  1151. var oozieUser = this.get('globals').someProperty('name', 'oozie_user') ? this.get('globals').findProperty('name', 'oozie_user').value : null;
  1152. var isHiveSelected = this.get('selectedServices').someProperty('serviceName', 'HIVE');
  1153. var hiveUser = this.get('globals').someProperty('name', 'hive_user') ? this.get('globals').findProperty('name', 'hive_user').value : null;
  1154. var isHcatSelected = this.get('selectedServices').someProperty('serviceName', 'WEBHCAT');
  1155. var hcatUser = this.get('globals').someProperty('name', 'hcat_user') ? this.get('globals').findProperty('name', 'hcat_user').value : null;
  1156. var isGLUSTERFSSelected = this.get('selectedServices').someProperty('serviceName', 'GLUSTERFS');
  1157. // screen out the GLUSTERFS-specific core-site.xml entries when they are not needed
  1158. if (!isGLUSTERFSSelected) {
  1159. coreSiteObj = coreSiteObj.filter(function(_config) {
  1160. return _config.name.indexOf("fs.glusterfs") < 0;
  1161. });
  1162. }
  1163. coreSiteObj.forEach(function (_coreSiteObj) {
  1164. if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
  1165. coreSiteProperties[_coreSiteObj.name] = App.config.escapeXMLCharacters(_coreSiteObj.value);
  1166. }
  1167. if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
  1168. coreSiteProperties[_coreSiteObj.name] = this.get('globals').someProperty('name', 'fs_glusterfs_default_name') ? App.config.escapeXMLCharacters(this.get('globals').findProperty('name', 'fs_glusterfs_default_name').value) : null;
  1169. }
  1170. if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.defaultFS") {
  1171. coreSiteProperties[_coreSiteObj.name] = this.get('globals').someProperty('name', 'glusterfs_defaultFS_name') ? App.config.escapeXMLCharacters(this.get('globals').findProperty('name', 'glusterfs_defaultFS_name').value) : null;
  1172. }
  1173. console.log("STEP*: name of the property is: " + _coreSiteObj.name);
  1174. console.log("STEP8: value of the property is: " + _coreSiteObj.value);
  1175. }, this);
  1176. return {"type": "core-site", "tag": "version1", "properties": coreSiteProperties};
  1177. },
  1178. createHdfsSiteObj: function () {
  1179. var hdfsSiteObj = this.get('configs').filterProperty('filename', 'hdfs-site.xml');
  1180. var hdfsProperties = {};
  1181. hdfsSiteObj.forEach(function (_configProperty) {
  1182. hdfsProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1183. console.log("STEP*: name of the property is: " + _configProperty.name);
  1184. console.log("STEP8: value of the property is: " + _configProperty.value);
  1185. }, this);
  1186. return {"type": "hdfs-site", "tag": "version1", "properties": hdfsProperties };
  1187. },
  1188. createLog4jObj: function (serviceName) {
  1189. var fileName = serviceName.toLowerCase();
  1190. var Log4jObj = this.get('configs').filterProperty('filename', fileName + '-log4j.xml');
  1191. var Log4jProperties = {};
  1192. Log4jObj.forEach(function (_configProperty) {
  1193. Log4jProperties[_configProperty.name] = _configProperty.value;
  1194. console.log("STEP*: name of the property is: " + _configProperty.name);
  1195. console.log("STEP8: value of the property is: " + _configProperty.value);
  1196. }, this);
  1197. return {"type": fileName + "-log4j", "tag": "version1", "properties": Log4jProperties };
  1198. },
  1199. createHueSiteObj: function () {
  1200. var hueSiteObj = this.get('configs').filterProperty('filename', 'hue-site.xml');
  1201. var hueProperties = {};
  1202. hueSiteObj.forEach(function (_configProperty) {
  1203. hueProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1204. console.log("STEP*: name of the property is: " + _configProperty.name);
  1205. console.log("STEP8: value of the property is: " + _configProperty.value);
  1206. }, this);
  1207. return {"type": "hue-site", "tag": "version1", "properties": hueProperties };
  1208. },
  1209. createMrSiteObj: function () {
  1210. var configs = this.get('configs').filterProperty('filename', 'mapred-site.xml');
  1211. var mrProperties = {};
  1212. configs.forEach(function (_configProperty) {
  1213. mrProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1214. console.log("STEP*: name of the property is: " + _configProperty.name);
  1215. console.log("STEP8: value of the property is: " + _configProperty.value);
  1216. }, this);
  1217. return {type: 'mapred-site', tag: 'version1', properties: mrProperties};
  1218. },
  1219. createYarnSiteObj: function () {
  1220. var configs = this.get('configs').filterProperty('filename', 'yarn-site.xml');
  1221. var mrProperties = {};
  1222. configs.forEach(function (_configProperty) {
  1223. mrProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1224. console.log("STEP*: name of the property is: " + _configProperty.name);
  1225. console.log("STEP8: value of the property is: " + _configProperty.value);
  1226. }, this);
  1227. return {type: 'yarn-site', tag: 'version1', properties: mrProperties};
  1228. },
  1229. createCapacityScheduler: function () {
  1230. var configs = this.get('configs').filterProperty('filename', 'capacity-scheduler.xml');
  1231. var csProperties = {};
  1232. configs.forEach(function (_configProperty) {
  1233. csProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1234. console.log("STEP*: name of the property is: " + _configProperty.name);
  1235. console.log("STEP8: value of the property is: " + _configProperty.value);
  1236. }, this);
  1237. return {type: 'capacity-scheduler', tag: 'version1', properties: csProperties};
  1238. },
  1239. createMapredQueueAcls: function () {
  1240. var configs = this.get('configs').filterProperty('filename', 'mapred-queue-acls.xml');
  1241. var mqProperties = {};
  1242. configs.forEach(function (_configProperty) {
  1243. mqProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1244. console.log("STEP*: name of the property is: " + _configProperty.name);
  1245. console.log("STEP8: value of the property is: " + _configProperty.value);
  1246. }, this);
  1247. return {type: 'mapred-queue-acls', tag: 'version1', properties: mqProperties};
  1248. },
  1249. createHbaseSiteObj: function () {
  1250. var configs = this.get('configs').filterProperty('filename', 'hbase-site.xml');
  1251. var hbaseProperties = {};
  1252. configs.forEach(function (_configProperty) {
  1253. hbaseProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1254. }, this);
  1255. return {type: 'hbase-site', tag: 'version1', properties: hbaseProperties};
  1256. },
  1257. createOozieSiteObj: function () {
  1258. var configs = this.get('configs').filterProperty('filename', 'oozie-site.xml');
  1259. var oozieProperties = {};
  1260. configs.forEach(function (_configProperty) {
  1261. oozieProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1262. }, this);
  1263. return {type: 'oozie-site', tag: 'version1', properties: oozieProperties};
  1264. },
  1265. createHiveSiteObj: function () {
  1266. var configs = this.get('configs').filterProperty('filename', 'hive-site.xml');
  1267. var hiveProperties = {};
  1268. configs.forEach(function (_configProperty) {
  1269. hiveProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1270. }, this);
  1271. return {type: 'hive-site', tag: 'version1', properties: hiveProperties};
  1272. },
  1273. createWebHCatSiteObj: function () {
  1274. var configs = this.get('configs').filterProperty('filename', 'webhcat-site.xml');
  1275. var webHCatProperties = {};
  1276. configs.forEach(function (_configProperty) {
  1277. webHCatProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1278. }, this);
  1279. return {type: 'webhcat-site', tag: 'version1', properties: webHCatProperties};
  1280. },
  1281. createZooCfgObj: function () {
  1282. var configs = this.get('configs').filterProperty('filename', 'zoo.cfg');
  1283. var csProperties = {};
  1284. configs.forEach(function (_configProperty) {
  1285. csProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1286. }, this);
  1287. return {type: 'zoo.cfg', tag: 'version1', properties: csProperties};
  1288. },
  1289. createStormSiteObj: function () {
  1290. var configs = this.get('configs').filterProperty('filename', 'storm-site.xml');
  1291. var stormProperties = {};
  1292. var specialProperties = ["storm.zookeeper.servers", "nimbus.childopts", "supervisor.childopts", "worker.childopts"];
  1293. configs.forEach(function (_configProperty) {
  1294. if (specialProperties.contains(_configProperty.name)) {
  1295. if (_configProperty.name == "storm.zookeeper.servers") {
  1296. stormProperties[_configProperty.name] = JSON.stringify(_configProperty.value).replace(/"/g, "'");
  1297. } else {
  1298. stormProperties[_configProperty.name] = JSON.stringify(_configProperty.value).replace(/"/g,"");
  1299. }
  1300. } else {
  1301. stormProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1302. }
  1303. }, this);
  1304. return {type: 'storm-site', tag: 'version1', properties: stormProperties};
  1305. },
  1306. createTezSiteObj: function () {
  1307. var configs = this.get('configs').filterProperty('filename', 'tez-site.xml');
  1308. var tezProperty = {};
  1309. configs.forEach(function (_configProperty) {
  1310. tezProperty[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1311. }, this);
  1312. return {type: 'tez-site', tag: 'version1', properties: tezProperty};
  1313. },
  1314. createFalconStartupSiteObj: function () {
  1315. var configs = this.get('configs').filterProperty('filename', 'falcon-startup.properties.xml');
  1316. var falconStartupProperties = {};
  1317. configs.forEach(function (_configProperty) {
  1318. falconStartupProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1319. }, this);
  1320. return {type: 'falcon-startup.properties', tag: 'version1', properties: falconStartupProperties};
  1321. },
  1322. createFalconRuntimeSiteObj: function () {
  1323. var configs = this.get('configs').filterProperty('filename', 'falcon-runtime.properties.xml');
  1324. var falconRuntimeProperties = {};
  1325. configs.forEach(function (_configProperty) {
  1326. falconRuntimeProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
  1327. }, this);
  1328. return {type: 'falcon-runtime.properties', tag: 'version1', properties: falconRuntimeProperties};
  1329. },
  1330. ajaxQueueFinished: function () {
  1331. //do something
  1332. },
  1333. doNextAjaxCall: function () {
  1334. if (this.get('ajaxBusy')) {
  1335. return;
  1336. }
  1337. var queue = this.get('ajaxQueue');
  1338. if (!queue.length) {
  1339. this.ajaxQueueFinished();
  1340. return;
  1341. }
  1342. var first = queue[0];
  1343. this.set('ajaxQueue', queue.slice(1));
  1344. this.set('ajaxQueueLeft', this.get('ajaxQueue').length);
  1345. this.set('ajaxBusy', true);
  1346. $.ajax(first);
  1347. },
  1348. /**
  1349. * We need to do a lot of ajax calls async in special order. To do this,
  1350. * generate array of ajax objects and then send requests step by step. All
  1351. * ajax objects are stored in <code>ajaxQueue</code>
  1352. *
  1353. * @param params
  1354. */
  1355. ajax: function (params) {
  1356. if (App.testMode) return;
  1357. var self = this;
  1358. params = jQuery.extend({
  1359. async: true,
  1360. dataType: 'text',
  1361. statusCode: require('data/statusCodes'),
  1362. timeout: App.timeout,
  1363. error: function (request, ajaxOptions, error) {
  1364. console.log('Step8: In Error ');
  1365. // console.log('Step8: Error message is: ' + request.responseText);
  1366. },
  1367. success: function (data) {
  1368. console.log("TRACE: STep8 -> In success function");
  1369. }
  1370. }, params);
  1371. var success = params.success;
  1372. var error = params.error;
  1373. params.success = function () {
  1374. if (success) {
  1375. success();
  1376. }
  1377. self.set('ajaxBusy', false);
  1378. self.doNextAjaxCall();
  1379. };
  1380. params.error = function (xhr, status, error) {
  1381. var responseText = JSON.parse(xhr.responseText);
  1382. var controller = App.router.get(App.clusterStatus.wizardControllerName);
  1383. controller.registerErrPopup(Em.I18n.t('common.error'), responseText.message);
  1384. self.set('hasErrorOccurred', true);
  1385. // an error will break the ajax call chain and allow submission again
  1386. self.set('isSubmitDisabled', false);
  1387. self.set('isBackBtnDisabled', false);
  1388. App.router.get(self.get('content.controllerName')).setStepsEnable();
  1389. self.get('ajaxQueue').clear();
  1390. self.set('ajaxBusy', false);
  1391. };
  1392. this.get('ajaxQueue').pushObject(params);
  1393. }
  1394. });