Browse Source

AMBARI-2845. NameNode HA Wizard: E2E integration for progress page after "Initialize JournalNodes". (Antonenko Alexander via yusaku)

Yusaku Sako 11 years ago
parent
commit
d2a20742f8

+ 9 - 7
ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js

@@ -37,8 +37,8 @@ App.HighAvailabilityProgressPageController = Em.Controller.extend({
 
   clearStep: function () {
     this.set('isSubmitDisabled', true);
-    this.get('tasks').clear();
-    this.get('logs').clear();
+    this.set('tasks', []);
+    this.set('logs', []);
     var commands = this.get('commands');
     var currentStep = App.router.get('highAvailabilityWizardController.currentStep');
     for (var i = 0; i < commands.length; i++) {
@@ -112,8 +112,8 @@ App.HighAvailabilityProgressPageController = Em.Controller.extend({
   },
 
   onCreateComponent: function () {
-    var hostName = arguments[2].data.hostName;
-    var componentName = arguments[2].data.componentName;
+    var hostName = arguments[2].hostName;
+    var componentName = arguments[2].componentName;
     this.installComponent(componentName, hostName);
   },
 
@@ -160,7 +160,7 @@ App.HighAvailabilityProgressPageController = Em.Controller.extend({
   startPolling: function (data) {
     if (data) {
       this.get('currentRequestIds').push(data.Requests.id);
-      var tasksCount = arguments[2].data ? arguments[2].data.taskNum : 1;
+      var tasksCount = arguments[2].taskNum || 1;
       if (tasksCount === this.get('currentRequestIds').length) {
         this.doPolling();
       }
@@ -199,20 +199,22 @@ App.HighAvailabilityProgressPageController = Em.Controller.extend({
         } else {
           this.setTaskStatus(currentTaskId, 'COMPLETED');
         }
+        this.set('currentRequestIds', []);
       } else {
-        var progress = Math.round(tasks.filterProperty('Tasks.status', 'COMPLETED').length / tasks.length * 100);
+        var progress = Math.round((tasks.filterProperty('Tasks.status', 'COMPLETED').length + tasks.filterProperty('Tasks.status', 'IN_PROGRESS').length / 2) / tasks.length * 100);
         this.get('tasks').findProperty('id', currentTaskId).set('progress', progress);
         this.setTaskStatus(currentTaskId, 'IN_PROGRESS');
         window.setTimeout(function () {
           self.doPolling()
         }, self.POLL_INTERVAL);
       }
-      this.get('logs').clear();
+      this.set('logs', []);
     }
   },
 
   done: function () {
     if (!this.get('isSubmitDisabled')) {
+      this.removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
       App.router.send('next');
     }
   }

+ 2 - 2
ambari-web/app/controllers/main/admin/highAvailability/step7_controller.js

@@ -23,12 +23,12 @@ App.HighAvailabilityWizardStep7Controller = App.HighAvailabilityProgressPageCont
   commands: ['startZooKeeperServers', 'startNameNode'],
 
   startZooKeeperServers: function () {
-    var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'ZOOKEEPER').mapProperty('hostName');
+    var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
     this.startComponent('ZOOKEEPER_SERVER', hostNames);
   },
 
   startNameNode: function () {
-    var hostName = this.get('content.masterComponentHosts').findProperty('isCurNameNode').mapProperty('hostName');
+    var hostName = this.get('content.masterComponentHosts').findProperty('isCurNameNode').hostName;
     this.startComponent('NAMENODE', hostName);
   }
 });