You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/08/09 19:44:51 UTC

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

Updated Branches:
  refs/heads/trunk 436394607 -> d2a20742f


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


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/d2a20742
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/d2a20742
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/d2a20742

Branch: refs/heads/trunk
Commit: d2a20742f85925ca9fac573f7771deaa33d0c0fe
Parents: 4363946
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Fri Aug 9 10:44:20 2013 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Fri Aug 9 10:44:20 2013 -0700

----------------------------------------------------------------------
 .../admin/highAvailability/progress_controller.js   | 16 +++++++++-------
 .../main/admin/highAvailability/step7_controller.js |  4 ++--
 2 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d2a20742/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
index 928ee1f..d5a79d7 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/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');
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d2a20742/ambari-web/app/controllers/main/admin/highAvailability/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step7_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step7_controller.js
index 914bb98..ce75863 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/step7_controller.js
+++ b/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);
   }
 });