incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-3313. Empty operations info in popups in HA wizard step5 "Configure Components", step7 "Start Components", step9 "Finalize HA Setup", "Rollback" after page refresh. (alexantonenko)
Date Mon, 23 Sep 2013 16:23:46 GMT
Updated Branches:
  refs/heads/branch-1.4.1 c79279613 -> 7e0d03388


AMBARI-3313. Empty operations info in popups in HA wizard step5 "Configure Components", step7
"Start Components", step9 "Finalize HA Setup", "Rollback" after page refresh. (alexantonenko)


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

Branch: refs/heads/branch-1.4.1
Commit: 7e0d03388b7a5f329de8a11590078b95aeeecf4c
Parents: c792796
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Mon Sep 23 19:19:29 2013 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Mon Sep 23 19:19:29 2013 +0300

----------------------------------------------------------------------
 .../highAvailability/progress_controller.js     | 15 ++++++++---
 .../highAvailability/rollback_controller.js     | 26 +++-----------------
 .../admin/highAvailability/wizard_controller.js | 11 +++++++++
 ambari-web/app/routes/main.js                   |  6 ++---
 ambari-web/app/utils/db.js                      | 11 +++++++++
 5 files changed, 40 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7e0d0338/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 d3aaa7c..3003bae 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -70,9 +70,11 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
 
   loadTasks: function () {
     var loadedStauses = this.get('content.tasksStatuses');
-    if (loadedStauses && loadedStauses.length === this.get('tasks').length) {
+    var loadedLogs = this.get('content.logs');
+    if (loadedStauses && loadedLogs && loadedStauses.length === this.get('tasks').length)
{
       for (var i = 0; i < loadedStauses.length; i++) {
         this.setTaskStatus(i, loadedStauses[i]);
+        this.restoreTaskLog(i, loadedLogs[i]);
       }
       if (loadedStauses.contains('IN_PROGRESS')) {
         this.set('currentRequestIds', this.get('content.requestIds'));
@@ -86,6 +88,10 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
     this.get('tasks').findProperty('id', taskId).set('status', status);
   },
 
+  restoreTaskLog: function (taskId, log) {
+    this.get('tasks').findProperty('id', taskId).set('hosts', log);
+  },
+
   setTaskLogs: function (taskId, tasks) {
     var hosts = [];
     var uniqHosts = tasks.mapProperty('Tasks.host_name').uniq();
@@ -134,24 +140,25 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
       var nextTask = this.get('tasks').findProperty('status', 'PENDING');
       if (nextTask) {
         this.set('status', 'IN_PROGRESS');
+        this.runTask(nextTask.get('id'));
         this.setTaskStatus(nextTask.get('id'), 'QUEUED');
         this.set('currentTaskId', nextTask.get('id'));
-        this.runTask(nextTask.get('id'));
       } else {
         this.set('status', 'COMPLETED');
         this.set('isSubmitDisabled', false);
       }
     } else if (this.get('tasks').someProperty('status', 'FAILED')) {
-      console.warn('onTaskStatusChange4');
       this.set('status', 'FAILED');
       this.get('tasks').findProperty('status', 'FAILED').set('showRetry', true);
       this.get('tasks').findProperty('status', 'FAILED').set('showRollback', true);
     }
 
     var statuses = this.get('tasks').mapProperty('status');
+    var logs = this.get('tasks').mapProperty('hosts');
     var requestIds = this.get('currentRequestIds');
     App.router.get(this.get('content.controllerName')).saveTasksStatuses(statuses);
     App.router.get(this.get('content.controllerName')).saveRequestIds(requestIds);
+    App.router.get(this.get('content.controllerName')).saveLogs(logs);
     App.clusterStatus.setClusterStatus({
       clusterName: this.get('content.cluster.name'),
       clusterState: 'HIGH_AVAILABILITY_DEPLOY',
@@ -285,6 +292,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
       }, this);
       var self = this;
       var currentTaskId = this.get('currentTaskId');
+      this.setTaskLogs(currentTaskId, tasks);
       if (!tasks.someProperty('Tasks.status', 'PENDING') && !tasks.someProperty('Tasks.status',
'QUEUED') && !tasks.someProperty('Tasks.status', 'IN_PROGRESS')) {
         this.set('currentRequestIds', []);
         if (tasks.someProperty('Tasks.status', 'FAILED')  || tasks.someProperty('status',
'TIMEDOUT') || tasks.someProperty('status', 'ABORTED')) {
@@ -306,7 +314,6 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
           self.doPolling()
         }, self.POLL_INTERVAL);
       }
-      this.setTaskLogs(currentTaskId, tasks);
       this.set('logs', []);
     }
   },

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7e0d0338/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
index f15bac7..0170dec 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
@@ -128,23 +128,25 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
       var nextTask = this.get('tasks').findProperty('status', 'PENDING');
       if (nextTask) {
         this.set('status', 'IN_PROGRESS');
+        this.runTask(nextTask.get('id'));
         this.setTaskStatus(nextTask.get('id'), 'QUEUED');
         this.set('currentTaskId', nextTask.get('id'));
-        this.runTask(nextTask.get('id'));
       } else {
         this.set('status', 'COMPLETED');
         this.set('isSubmitDisabled', false);
       }
-    } else if (this.get('tasks').someProperty('status', 'FAILED') || this.get('tasks').someProperty('status',
'TIMEDOUT') || this.get('tasks').someProperty('status', 'ABORTED')) {
+    } else if (this.get('tasks').someProperty('status', 'FAILED')) {
       this.set('status', 'FAILED');
       this.get('tasks').findProperty('status', 'FAILED').set('showRetry', true);
       this.get('tasks').findProperty('status', 'FAILED').set('showSkip', true);
     }
 
     var statuses = this.get('tasks').mapProperty('status');
+    var logs = this.get('tasks').mapProperty('hosts');
     var requestIds = this.get('currentRequestIds');
     this.saveTasksStatuses(statuses);
     this.saveRequestIds(requestIds);
+    this.saveLogs(logs);
     App.clusterStatus.setClusterStatus({
       clusterName: this.get('content.cluster.name'),
       clusterState: 'HIGH_AVAILABILITY_ROLLBACK',
@@ -171,31 +173,11 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
     return this.get('tasks').findProperty('id', taskId).get('status');
   },
 
-  saveTasksStatuses: function(statuses){
-    App.db.setHighAvailabilityWizardTasksStatuses(statuses);
-    this.set('content.tasksStatuses', statuses);
-  },
-
-  loadTasksStatuses: function(){
-    var statuses = App.db.getHighAvailabilityWizardTasksStatuses();
-    this.set('content.tasksStatuses', statuses);
-  },
-
   loadFailedTask: function(){
     var failedTask = App.db.getHighAvailabilityWizardFailedTask();
     this.set('failedTask', failedTask);
   },
 
-  saveRequestIds: function(requestIds){
-    App.db.setHighAvailabilityWizardRequestIds(requestIds);
-    this.set('content.requestIds', requestIds);
-  },
-
-  loadRequestIds: function(){
-    var requestIds = App.db.getHighAvailabilityWizardRequestIds();
-    this.set('content.requestIds', requestIds);
-  },
-
   done: function () {
     if (!this.get('isSubmitDisabled')) {
       this.removeObserver('tasks.@each.status', this, 'onTaskStatusChange');

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7e0d0338/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
index 680ce5b..82b03bc 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
@@ -197,11 +197,21 @@ App.HighAvailabilityWizardController = App.WizardController.extend({
     this.set('content.requestIds', requestIds);
   },
 
+  saveLogs: function(logs){
+    App.db.setHighAvailabilityWizardLogs(logs);
+    this.set('content.logs', logs);
+  },
+
   loadRequestIds: function(){
     var requestIds = App.db.getHighAvailabilityWizardRequestIds();
     this.set('content.requestIds', requestIds);
   },
 
+  loadLogs: function(){
+    var logs = App.db.getHighAvailabilityWizardLogs();
+    this.set('content.logs', logs);
+  },
+
   saveNameServiceId: function(nameServiceId){
     App.db.setHighAvailabilityWizardNameServiceId(nameServiceId);
     this.set('content.nameServiceId', nameServiceId);
@@ -226,6 +236,7 @@ App.HighAvailabilityWizardController = App.WizardController.extend({
         this.loadNameServiceId();
         this.loadTasksStatuses();
         this.loadRequestIds();
+        this.loadLogs();
       case '4':
       case '3':
       case '2':

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7e0d0338/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 138ee42..4183114 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -678,9 +678,9 @@ module.exports = Em.Route.extend({
             highAvailabilityWizardController.finish();
             highAvailabilityWizardController.get('popup').hide();
           }
-            highAvailabilityRollbackController =  router.get('highAvailabilityRollbackController')
-            highAvailabilityRollbackController.loadTasksStatuses();
-            highAvailabilityRollbackController.loadRequestIds();
+          highAvailabilityWizardController.loadTasksStatuses();
+          highAvailabilityWizardController.loadRequestIds();
+          highAvailabilityWizardController.loadLogs();
           var popup = App.ModalPopup.show({
             classNames: ['full-width-modal'],
             header: Em.I18n.t('admin.highAvailability.rollback.header'),

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7e0d0338/ambari-web/app/utils/db.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index c4f6dc6..d89ab2c 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -379,6 +379,12 @@ App.db.setHighAvailabilityWizardRequestIds = function (requestIds) {
   localStorage.setObject('ambari', App.db.data);
 };
 
+App.db.setHighAvailabilityWizardLogs = function (logs) {
+  App.db.data = localStorage.getObject('ambari');
+  App.db.data.HighAvailabilityWizard.logs = logs;
+  localStorage.setObject('ambari', App.db.data);
+};
+
 App.db.setHighAvailabilityWizardNameServiceId = function (nameServiceId) {
   App.db.data = localStorage.getObject('ambari');
   App.db.data.HighAvailabilityWizard.nameServiceId = nameServiceId;
@@ -623,6 +629,11 @@ App.db.getHighAvailabilityWizardRequestIds = function () {
   return App.db.data.HighAvailabilityWizard.requestIds;
 };
 
+App.db.getHighAvailabilityWizardLogs = function () {
+  App.db.data = localStorage.getObject('ambari');
+  return App.db.data.HighAvailabilityWizard.logs;
+};
+
 App.db.getHighAvailabilityWizardNameServiceId = function () {
   App.db.data = localStorage.getObject('ambari');
   return App.db.data.HighAvailabilityWizard.nameServiceId;


Mime
View raw message