step9_controller.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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. App.WizardStep9Controller = Em.Controller.extend({
  20. name: 'wizardStep9Controller',
  21. hosts: [],
  22. progress: '0',
  23. isStepCompleted: false,
  24. isSubmitDisabled: function () {
  25. //return false;
  26. return !this.get('isStepCompleted'); //TODO: uncomment after the hook up
  27. }.property('isStepCompleted'),
  28. mockHostData: require('data/mock/step9_hosts'),
  29. pollDataCounter: 0,
  30. polledData: [],
  31. status: function () {
  32. if (this.hosts.everyProperty('status', 'success')) {
  33. return 'success';
  34. } else if (this.hosts.someProperty('status', 'failed')) {
  35. return 'failed';
  36. } else if (this.hosts.someProperty('status', 'warning')) {
  37. return 'warning';
  38. } else {
  39. return 'info';
  40. }
  41. }.property('hosts.@each.status'),
  42. navigateStep: function () {
  43. //TODO: uncomment following line after the hook up with the API call
  44. if (this.get('content.cluster.isCompleted') === false) {
  45. this.loadStep();
  46. if (App.db.getClusterStatus().isInstallError === true) {
  47. this.set('isStepCompleted', true);
  48. this.set('status', 'failed');
  49. this.set('progress', '100');
  50. } else if (App.db.getClusterStatus().isStartError === true) {
  51. this.launchStartServices();
  52. } else {
  53. this.startPolling();
  54. }
  55. } else {
  56. this.set('isStepCompleted', true);
  57. this.set('progress', '100');
  58. }
  59. },
  60. clearStep: function () {
  61. this.hosts.clear();
  62. this.set('status', 'info');
  63. this.set('progress', '0');
  64. this.set('isStepCompleted', false);
  65. },
  66. loadStep: function () {
  67. console.log("TRACE: Loading step9: Install, Start and Test");
  68. this.clearStep();
  69. this.renderHosts(this.loadHosts());
  70. },
  71. loadHosts: function () {
  72. var hostInfo = [];
  73. hostInfo = App.db.getHosts();
  74. var hosts = new Ember.Set();
  75. for (var index in hostInfo) {
  76. hosts.add(hostInfo[index]);
  77. console.log("TRACE: host name is: " + hostInfo[index].name);
  78. }
  79. return hosts;
  80. //return hosts.filterProperty('bootStatus', 'success'); //TODO: uncomment after actual hookup with bootstrap
  81. },
  82. renderHosts: function (hostsInfo) {
  83. hostsInfo.forEach(function (_hostInfo) {
  84. var hostInfo = App.HostInfo.create({
  85. name: _hostInfo.name,
  86. status: _hostInfo.status,
  87. tasks: _hostInfo.tasks,
  88. message: _hostInfo.message,
  89. progress: _hostInfo.progress
  90. });
  91. console.log('pushing ' + hostInfo.name);
  92. this.hosts.pushObject(hostInfo);
  93. }, this);
  94. },
  95. replacePolledData: function (polledData) {
  96. this.polledData.clear;
  97. this.set('polledData', polledData);
  98. console.log('*******/ In replace PolledData function **********/');
  99. console.log("The value of polleddata is: " + polledData);
  100. console.log("2.The value of polleddata is: " + this.get('polledData'));
  101. this.get('polledData').forEach(function (_data) {
  102. console.log('The name of the host is: ' + _data.Tasks.host_name);
  103. console.log('The status of the task is: ' + _data.Tasks.status);
  104. }, this);
  105. },
  106. displayMessage: function (task) {
  107. console.log("In display message with task command value: " + task.command);
  108. switch (task.command) {
  109. case 'INSTALL':
  110. switch (task.status) {
  111. case 'PENDING':
  112. return 'Preparing to install ' + task.role;
  113. case 'QUEUED' :
  114. return task.role + ' is Queued for installation';
  115. case 'IN_PROGRESS':
  116. return 'Installing ' + task.role;
  117. case 'COMPLETED' :
  118. return 'Successfully installed ' + task.role;
  119. case 'FAILED':
  120. return 'Faliure in installing ' + task.role;
  121. }
  122. case 'UNINSTALL':
  123. switch (task.status) {
  124. case 'PENDING':
  125. return 'Preparing to uninstall ' + task.role;
  126. case 'QUEUED' :
  127. return task.role + ' is Queued for uninstallation';
  128. case 'IN_PROGRESS':
  129. return 'Unnstalling ' + task.role;
  130. case 'COMPLETED' :
  131. return 'Successfully uninstalled ' + task.role;
  132. case 'FAILED':
  133. return 'Faliure in uninstalling ' + task.role;
  134. }
  135. case 'START' :
  136. switch (task.status) {
  137. case 'PENDING':
  138. return 'Preparing to start ' + task.role;
  139. case 'QUEUED' :
  140. return task.role + ' is Queued for starting';
  141. case 'IN_PROGRESS':
  142. return 'Starting ' + task.role;
  143. case 'COMPLETED' :
  144. return task.role + ' started successfully';
  145. case 'FAILED':
  146. return task.role + ' failed to start';
  147. }
  148. case 'STOP' :
  149. switch (task.status) {
  150. case 'PENDING':
  151. return 'Preparing to stop ' + role;
  152. case 'QUEUED' :
  153. return task.role + ' is Queued for stopping';
  154. case 'IN_PROGRESS':
  155. return 'Stopping ' + task.role;
  156. case 'COMPLETED' :
  157. return role + ' stoped successfully';
  158. case 'FAILED':
  159. return role + ' failed to stop';
  160. }
  161. case 'EXECUTE' :
  162. switch (task.status) {
  163. case 'PENDING':
  164. return 'Preparing to execute' + task.role;
  165. case 'QUEUED' :
  166. return task.role + ' is Queued for execution';
  167. case 'IN_PROGRESS':
  168. return 'Execution of ' + task.role + ' in progress';
  169. case 'COMPLETED' :
  170. return task.role + ' executed successfully';
  171. case 'FAILED':
  172. return task.role + ' failed to execute';
  173. }
  174. case 'ABORT' :
  175. switch (task.status) {
  176. case 'PENDING':
  177. return 'Preparing to abort ' + task.role;
  178. case 'QUEUED' :
  179. return task.role + ' is Queued for Aborting';
  180. case 'IN_PROGRESS':
  181. return 'Aborting ' + task.role;
  182. case 'COMPLETED' :
  183. return task.role + ' aborted successfully';
  184. case 'FAILED':
  185. return task.role + ' failed to abort';
  186. }
  187. }
  188. },
  189. launchStartServices: function () {
  190. var self = this;
  191. var clusterName = this.get('content.cluster.name');
  192. var url = '/api/clusters/' + clusterName + '/services?state=INSTALLED';
  193. var data = '{"ServiceInfo": {"state": "STARTED"}}';
  194. var method = 'PUT';
  195. if (App.testMode) {
  196. debugger;
  197. url = '/data/wizard/deploy/poll_6.json';
  198. method = 'GET';
  199. this.numPolls = 6;
  200. }
  201. $.ajax({
  202. type: method,
  203. url: url,
  204. async: false,
  205. data: data,
  206. dataType: 'text',
  207. timeout: 5000,
  208. success: function (data) {
  209. var jsonData = jQuery.parseJSON(data);
  210. console.log("TRACE: Step9 -> In success function for the startService call");
  211. console.log("TRACE: Step9 -> value of the url is: " + url);
  212. console.log("TRACE: Step9 -> value of the received data is: " + jsonData);
  213. var requestId = jsonData.href.match(/.*\/(.*)$/)[1];
  214. console.log('requestId is: ' + requestId);
  215. var clusterStatus = {
  216. status: 'INSTALLED',
  217. requestId: requestId,
  218. isStartError: false,
  219. isCompleted: false
  220. };
  221. App.router.get('installerController').saveClusterStatus(clusterStatus);
  222. self.startPolling();
  223. },
  224. error: function () {
  225. console.log("ERROR");
  226. var clusterStatus = {
  227. status: 'PENDING',
  228. isStartError: true,
  229. isCompleted: false
  230. };
  231. App.router.get('installerController').saveClusterStatus(clusterStatus);
  232. },
  233. statusCode: require('data/statusCodes')
  234. });
  235. },
  236. onSuccessPerHost: function (actions, contentHost) {
  237. if (actions.everyProperty('Tasks.status', 'COMPLETED') && this.get('content.cluster.status') === 'INSTALLED') {
  238. contentHost.set('status', 'success');
  239. }
  240. },
  241. onWarningPerHost: function (actions, contentHost) {
  242. if (actions.findProperty('Tasks.status', 'FAILED') || actions.findProperty('Tasks.status', 'ABORTED') || actions.findProperty('Tasks.status', 'TIMEDOUT')) {
  243. console.log('step9: In warning');
  244. contentHost.set('status', 'warning');
  245. this.set('status', 'warning');
  246. }
  247. },
  248. onInProgressPerHost: function (tasks, contentHost) {
  249. var runningAction = tasks.findProperty('Tasks.status', 'IN_PROGRESS');
  250. if (runningAction === undefined || runningAction === null) {
  251. runningAction = tasks.findProperty('Tasks.status', 'QUEUED');
  252. }
  253. if (runningAction === undefined || runningAction === null) {
  254. runningAction = tasks.findProperty('Tasks.status', 'PENDING');
  255. }
  256. if (runningAction !== null && runningAction !== undefined) {
  257. contentHost.set('message', this.displayMessage(runningAction.Tasks));
  258. }
  259. },
  260. progressPerHost: function (actions, contentHost) {
  261. var progress = 0;
  262. var actionsPerHost = actions.length;
  263. var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length
  264. + actions.filterProperty('Tasks.status', 'IN_PROGRESS').length
  265. + actions.filterProperty('Tasks.status', 'FAILED').length
  266. + actions.filterProperty('Tasks.status', 'ABORTED').length
  267. + actions.filterProperty('Tasks.status', 'TIMEDOUT').length;
  268. if (this.get('content.cluster.status') === 'PENDING') {
  269. progress = Math.floor(((completedActions / actionsPerHost) * 100) / 3);
  270. } else if (this.get('content.cluster.status') === 'INSTALLED') {
  271. progress = 34 + Math.floor(((completedActions / actionsPerHost) * 100 * 2) / 3);
  272. }
  273. console.log('INFO: progressPerHost is: ' + progress);
  274. contentHost.set('progress', progress.toString());
  275. return progress;
  276. },
  277. isSuccess: function (polledData) {
  278. return polledData.everyProperty('Tasks.status', 'COMPLETED');
  279. },
  280. isStepFailed: function (polledData) {
  281. var self = this;
  282. var result = false;
  283. polledData.forEach(function (_polledData) {
  284. _polledData.Tasks.sf = 100; //TODO: Remove this line after hook up with actual success factor
  285. var successFactor = _polledData.Tasks.sf;
  286. console.log("Step9: isStepFailed sf value: " + successFactor);
  287. var actionsPerRole = polledData.filterProperty('Tasks.role', _polledData.Tasks.role);
  288. var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');
  289. var actionsAborted = actionsPerRole.filterProperty('Tasks.status', 'ABORTED');
  290. var actionsTimedOut = actionsPerRole.filterProperty('Tasks.status', 'TIMEDOUT');
  291. if ((((actionsFailed.length + actionsAborted.length + actionsTimedOut.length) / actionsPerRole.length) * 100) > (100 - successFactor)) {
  292. console.log('TRACE: Entering success factor and result is failed');
  293. result = true;
  294. }
  295. });
  296. return result;
  297. },
  298. getFailedHostsForFailedRoles: function (polledData) {
  299. var hostArr = new Ember.Set();
  300. polledData.forEach(function (_polledData) {
  301. _polledData.sf = 100; //TODO: Remove this line after hook up with actual success factor
  302. var successFactor = _polledData.sf;
  303. var actionsPerRole = polledData.filterProperty('Tasks.role', _polledData.Tasks.role);
  304. var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');
  305. var actionsAborted = actionsPerRole.filterProperty('Tasks.status', 'ABORTED');
  306. var actionsTimedOut = actionsPerRole.filterProperty('Tasks.status', 'TIMEDOUT');
  307. if ((((actionsFailed.length + actionsAborted.length + actionsTimedOut.length) / actionsPerRole.length) * 100) > (100 - successFactor)) {
  308. actionsFailed.forEach(function (_actionFailed) {
  309. hostArr.add(_actionFailed.Tasks.host_name);
  310. });
  311. actionsAborted.forEach(function (_actionFailed) {
  312. hostArr.add(_actionFailed.Tasks.host_name);
  313. });
  314. actionsTimedOut.forEach(function (_actionFailed) {
  315. hostArr.add(_actionFailed.Tasks.host_name);
  316. });
  317. }
  318. });
  319. return hostArr;
  320. },
  321. setHostsStatus: function (hosts, status) {
  322. hosts.forEach(function (_host) {
  323. var host = this.hosts.findProperty('name', _host.Tasks.host_name);
  324. host.set('status', status);
  325. host.set('progress', '100');
  326. }, this);
  327. },
  328. // polling from ui stops only when no action has 'PENDING', 'QUEUED' or 'IN_PROGRESS' status
  329. finishState: function (polledData) {
  330. var clusterStatus = {};
  331. var retVal = false;
  332. var requestId = this.get('content.cluster.requestId');
  333. if (this.get('content.cluster.status') === 'INSTALLED') {
  334. if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
  335. this.set('progress', '100');
  336. clusterStatus = {
  337. status: 'INSTALLED',
  338. requestId: requestId,
  339. isCompleted: true
  340. }
  341. if (this.isSuccess(polledData)) {
  342. clusterStatus.status = 'STARTED';
  343. this.set('status', 'success');
  344. } else {
  345. if (this.isStepFailed(polledData)) {
  346. clusterStatus.status = 'FAILED';
  347. this.set('status', 'failed');
  348. this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData));
  349. }
  350. }
  351. App.router.get('installerController').saveClusterStatus(clusterStatus);
  352. this.set('isStepCompleted', true);
  353. retVal = true;
  354. }
  355. } else if (this.get('content.cluster.status') === 'PENDING') {
  356. if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
  357. clusterStatus = {
  358. status: 'PENDING',
  359. requestId: requestId,
  360. isCompleted: true
  361. }
  362. if (this.isStepFailed(polledData)) {
  363. clusterStatus.status = 'FAILED';
  364. this.set('progress', '100');
  365. this.set('status', 'failed');
  366. this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData), 'failed');
  367. this.set('isStepCompleted', true);
  368. } else {
  369. clusterStatus.status = 'INSTALLED';
  370. this.set('progress', '34');
  371. App.router.get('installerController').saveInstalledHosts(this);
  372. this.launchStartServices(); //TODO: uncomment after the actual hookup
  373. }
  374. App.router.get('installerController').saveClusterStatus(clusterStatus);
  375. retVal = true;
  376. }
  377. }
  378. return retVal;
  379. },
  380. getCompletedTasksForHost: function (host) {
  381. var hostname = host.get('name');
  382. var tasksPerHost = host.tasks.filterProperty('Tasks.host_name',hostname);
  383. var succededTasks = tasksPerHost.filterProperty('Tasks.status', 'COMPLETED');
  384. var inProgressTasks = tasksPerHost.filterProperty('Tasks.status', 'IN_PROGRESS');
  385. var listedTasksPerHost = succededTasks.concat(inProgressTasks).uniq();
  386. return listedTasksPerHost;
  387. },
  388. // This is done at HostRole level.
  389. setTasksStatePerHost: function(tasksPerHost,host) {
  390. var tasks = [];
  391. tasksPerHost.forEach(function(_taskPerHost){
  392. if(_taskPerHost.Tasks.status !== 'PENDING' &&_taskPerHost.Tasks.status !== 'QUEUED') {
  393. var task = host.tasks.findProperty('Tasks.id',_taskPerHost.Tasks.id);
  394. if(!(task && (task.Tasks.command === _taskPerHost.Tasks.command))) {
  395. host.tasks.pushObject(_taskPerHost);
  396. }
  397. }
  398. },this);
  399. },
  400. parseHostInfo: function (polledData) {
  401. console.log('TRACE: Entering host info function');
  402. var self = this;
  403. var totalProgress = 0;
  404. /* if (this.get('content.cluster.status') === 'INSTALLED') {
  405. totalProgress = 34;
  406. } else {
  407. totalProgress = 0;
  408. } */
  409. var tasksData = polledData.tasks;
  410. console.log("The value of tasksData is: " + tasksData);
  411. if (!tasksData) {
  412. console.log("Step9: ERROR: NO tasks availaible to process");
  413. }
  414. this.replacePolledData(tasksData);
  415. this.hosts.forEach(function (_host) {
  416. var actionsPerHost = tasksData.filterProperty('Tasks.host_name', _host.name); // retrieved from polled Data
  417. if (actionsPerHost.length === 0) {
  418. //alert('For testing with mockData follow the sequence: hit referesh,"mockData btn", "pollData btn", again "pollData btn"');
  419. //exit();
  420. }
  421. if (actionsPerHost !== null && actionsPerHost !== undefined && actionsPerHost.length !== 0) {
  422. this.onSuccessPerHost(actionsPerHost, _host); // every action should be a success
  423. this.onWarningPerHost(actionsPerHost, _host); // any action should be a faliure
  424. this.onInProgressPerHost(actionsPerHost, _host); // current running action for a host
  425. this.setTasksStatePerHost(actionsPerHost,_host);
  426. totalProgress = self.progressPerHost(actionsPerHost, _host);
  427. }
  428. }, this);
  429. totalProgress = Math.floor(totalProgress / this.hosts.length);
  430. this.set('progress', totalProgress.toString());
  431. console.log("INFO: right now the progress is: " + this.get('progress'));
  432. return this.finishState(tasksData);
  433. },
  434. startPolling: function () {
  435. this.set('isSubmitDisabled', true);
  436. this.doPolling();
  437. },
  438. numPolls: 0,
  439. getUrl: function () {
  440. var clusterName = this.get('content.cluster.name');
  441. var requestId = App.db.getClusterStatus().requestId;
  442. var url = '/api/clusters/' + clusterName + '/requests/' + requestId;
  443. console.log("URL for step9 is: " + url);
  444. return url;
  445. },
  446. POLL_INTERVAL: 4000,
  447. doPolling: function () {
  448. var self = this;
  449. var url = this.getUrl();
  450. if (App.testMode) {
  451. this.POLL_INTERVAL = 1;
  452. this.numPolls++;
  453. if (this.numPolls == 5) {
  454. // url = 'data/wizard/deploy/poll_5.json';
  455. url = 'data/wizard/deploy/poll_5_failed.json';
  456. } else {
  457. url = 'data/wizard/deploy/poll_' + this.numPolls + '.json';
  458. }
  459. debugger;
  460. }
  461. $.ajax({
  462. type: 'GET',
  463. url: url,
  464. async: true,
  465. timeout: 10000,
  466. dataType: 'text',
  467. success: function (data) {
  468. console.log("TRACE: In success function for the GET bootstrap call");
  469. console.log("TRACE: STep9 -> The value is: " + jQuery.parseJSON(data));
  470. var result = self.parseHostInfo(jQuery.parseJSON(data));
  471. if (result !== true) {
  472. window.setTimeout(function () {
  473. self.doPolling();
  474. }, self.POLL_INTERVAL);
  475. } else {
  476. self.stopPolling();
  477. }
  478. },
  479. error: function (request, ajaxOptions, error) {
  480. console.log("TRACE: STep9 -> In error function for the getService call");
  481. console.log("TRACE: STep9 -> value of the url is: " + url);
  482. console.log("TRACE: STep9 -> error code status is: " + request.status);
  483. self.stopPolling();
  484. },
  485. statusCode: require('data/statusCodes')
  486. });
  487. },
  488. stopPolling: function () {
  489. //TODO: uncomment following line after the hook up with the API call
  490. // this.set('isStepCompleted',true);
  491. },
  492. submit: function () {
  493. if (!this.get('isSubmitDisabled')) {
  494. this.set('content.cluster.status', this.get('status'));
  495. this.set('content.cluster.isCompleted', true);
  496. App.router.send('next');
  497. }
  498. },
  499. back: function () {
  500. if (!this.get('isSubmitDisabled')) {
  501. App.router.send('back');
  502. }
  503. },
  504. mockBtn: function () {
  505. this.set('isSubmitDisabled', false);
  506. this.hosts.clear();
  507. var hostInfo = this.mockHostData;
  508. this.renderHosts(hostInfo);
  509. },
  510. pollBtn: function () {
  511. this.set('isSubmitDisabled', false);
  512. var data1 = require('data/mock/step9PolledData/pollData_1');
  513. var data2 = require('data/mock/step9PolledData/pollData_2');
  514. var data3 = require('data/mock/step9PolledData/pollData_3');
  515. var data4 = require('data/mock/step9PolledData/pollData_4');
  516. var data5 = require('data/mock/step9PolledData/pollData_5');
  517. var data6 = require('data/mock/step9PolledData/pollData_6');
  518. var data7 = require('data/mock/step9PolledData/pollData_7');
  519. var data8 = require('data/mock/step9PolledData/pollData_8');
  520. var data9 = require('data/mock/step9PolledData/pollData_9');
  521. console.log("TRACE: In pollBtn function data1");
  522. var counter = parseInt(this.get('pollDataCounter')) + 1;
  523. this.set('pollDataCounter', counter.toString());
  524. switch (this.get('pollDataCounter')) {
  525. case '1':
  526. this.parseHostInfo(data1);
  527. break;
  528. case '2':
  529. this.parseHostInfo(data2);
  530. break;
  531. case '3':
  532. this.parseHostInfo(data3);
  533. break;
  534. case '4':
  535. this.parseHostInfo(data4);
  536. break;
  537. case '5':
  538. this.parseHostInfo(data5);
  539. break;
  540. case '6':
  541. this.set('content.cluster.status', 'INSTALLED');
  542. this.parseHostInfo(data6);
  543. break;
  544. case '7':
  545. this.parseHostInfo(data7);
  546. break;
  547. case '8':
  548. this.parseHostInfo(data8);
  549. break;
  550. case '9':
  551. this.parseHostInfo(data9);
  552. break;
  553. default:
  554. break;
  555. }
  556. }
  557. });