git commit: AMBARI-5242. Move wizard freezes on step Configure component, operation Install (component name). (Denys Buzhor via akovalenko)

2014-03-28 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/branch-1.5.0 4b28e139f - 7b04eab2e


AMBARI-5242. Move wizard freezes on step Configure component, operation 
Install (component name). (Denys Buzhor via akovalenko)


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

Branch: refs/heads/branch-1.5.0
Commit: 7b04eab2e1f533b1a12cb654535581c1d71ded73
Parents: 4b28e13
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Fri Mar 28 13:12:56 2014 +0200
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Fri Mar 28 13:13:27 2014 +0200

--
 .../highAvailability/progress_controller.js | 42 
 ambari-web/app/models/cluster_states.js | 21 --
 2 files changed, 42 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7b04eab2/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 a5c58e5..5875533 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -187,6 +187,28 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
 
   onTaskStatusChange: function () {
 console.warn('func: onTaskStatusChange1');
+var statuses = this.get('tasks').mapProperty('status');
+var logs = this.get('tasks').mapProperty('hosts');
+var requestIds = this.get('currentRequestIds');
+console.warn('func: onTaskStatusChange5',statuses, logs, requestIds);
+// save task info
+
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);
+// call saving of cluster status asynchronous
+// synchronous executing cause problems in Firefox
+App.clusterStatus.setClusterStatus({
+  clusterName: this.get('content.cluster.name'),
+  clusterState: this.get('clusterDeployState'),
+  wizardControllerName: this.get('content.controllerName'),
+  localdb: App.db.data
+}, { async: true, success: 'statusChangeCallback', sender: this });
+  },
+  /**
+   * Method that called after saving persist data to server.
+   * Switch task according its status.
+   */
+  statusChangeCallback: function() {
 if (!this.get('tasks').someProperty('status', 'IN_PROGRESS')  
!this.get('tasks').someProperty('status', 'QUEUED')  
!this.get('tasks').someProperty('status', 'FAILED')) {
   var nextTask = this.get('tasks').findProperty('status', 'PENDING');
   if (nextTask) {
@@ -210,24 +232,10 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
 }
 
this.get('tasks').filterProperty('status','COMPLETED').setEach('showRetry', 
false);
 
this.get('tasks').filterProperty('status','COMPLETED').setEach('showRollback', 
false);
-
-var statuses = this.get('tasks').mapProperty('status');
-var logs = this.get('tasks').mapProperty('hosts');
-var requestIds = this.get('currentRequestIds');
-console.warn('func: onTaskStatusChange5',statuses, logs, requestIds);
-
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: this.get('clusterDeployState'),
-  wizardControllerName: this.get('content.controllerName'),
-  localdb: App.db.data
-});
   },
 
-  /*
-   run command of appropriate task
+  /**
+   * Run command of appropriate task
*/
   runTask: function (taskId) {
 console.warn('func: runTask',taskId);
@@ -370,6 +378,7 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
 console.warn('func: doPolling');
 this.setTaskStatus(this.get('currentTaskId'), 'IN_PROGRESS');
 var requestIds = this.get('currentRequestIds');
+this.set('logs', []);
 for (var i = 0; i  requestIds.length; i++) {
   App.ajax.send({
 name: 'admin.high_availability.polling',
@@ -415,7 +424,6 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
   

git commit: AMBARI-5242. Move wizard freezes on step Configure component, operation Install (component name). (Denys Buzhor via akovalenko)

2014-03-27 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 1eec850c7 - 4be37e9b0


AMBARI-5242. Move wizard freezes on step Configure component, operation 
Install (component name). (Denys Buzhor via akovalenko)


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

Branch: refs/heads/trunk
Commit: 4be37e9b0a0c3d002c6fd24298a48c8f9b5bbda9
Parents: 1eec850
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Thu Mar 27 17:54:12 2014 +0200
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Thu Mar 27 17:54:12 2014 +0200

--
 .../highAvailability/progress_controller.js | 42 
 ambari-web/app/models/cluster_states.js | 21 --
 2 files changed, 42 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4be37e9b/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 a5c58e5..5875533 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -187,6 +187,28 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
 
   onTaskStatusChange: function () {
 console.warn('func: onTaskStatusChange1');
+var statuses = this.get('tasks').mapProperty('status');
+var logs = this.get('tasks').mapProperty('hosts');
+var requestIds = this.get('currentRequestIds');
+console.warn('func: onTaskStatusChange5',statuses, logs, requestIds);
+// save task info
+
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);
+// call saving of cluster status asynchronous
+// synchronous executing cause problems in Firefox
+App.clusterStatus.setClusterStatus({
+  clusterName: this.get('content.cluster.name'),
+  clusterState: this.get('clusterDeployState'),
+  wizardControllerName: this.get('content.controllerName'),
+  localdb: App.db.data
+}, { async: true, success: 'statusChangeCallback', sender: this });
+  },
+  /**
+   * Method that called after saving persist data to server.
+   * Switch task according its status.
+   */
+  statusChangeCallback: function() {
 if (!this.get('tasks').someProperty('status', 'IN_PROGRESS')  
!this.get('tasks').someProperty('status', 'QUEUED')  
!this.get('tasks').someProperty('status', 'FAILED')) {
   var nextTask = this.get('tasks').findProperty('status', 'PENDING');
   if (nextTask) {
@@ -210,24 +232,10 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
 }
 
this.get('tasks').filterProperty('status','COMPLETED').setEach('showRetry', 
false);
 
this.get('tasks').filterProperty('status','COMPLETED').setEach('showRollback', 
false);
-
-var statuses = this.get('tasks').mapProperty('status');
-var logs = this.get('tasks').mapProperty('hosts');
-var requestIds = this.get('currentRequestIds');
-console.warn('func: onTaskStatusChange5',statuses, logs, requestIds);
-
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: this.get('clusterDeployState'),
-  wizardControllerName: this.get('content.controllerName'),
-  localdb: App.db.data
-});
   },
 
-  /*
-   run command of appropriate task
+  /**
+   * Run command of appropriate task
*/
   runTask: function (taskId) {
 console.warn('func: runTask',taskId);
@@ -370,6 +378,7 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
 console.warn('func: doPolling');
 this.setTaskStatus(this.get('currentTaskId'), 'IN_PROGRESS');
 var requestIds = this.get('currentRequestIds');
+this.set('logs', []);
 for (var i = 0; i  requestIds.length; i++) {
   App.ajax.send({
 name: 'admin.high_availability.polling',
@@ -415,7 +424,6 @@ App.HighAvailabilityProgressPageController = 
App.HighAvailabilityWizardControlle
   self.doPolling()