ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-17737 Assign Masters: hosts change triggers too much validation calls. (atkach)
Date Fri, 15 Jul 2016 16:11:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 0eadaa6d8 -> 1cba6f459


AMBARI-17737 Assign Masters: hosts change triggers too much validation calls. (atkach)


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

Branch: refs/heads/trunk
Commit: 1cba6f4590cbc47233f902d946796aa29f7dd3cb
Parents: 0eadaa6
Author: Andrii Tkach <atkach@apache.org>
Authored: Fri Jul 15 16:52:12 2016 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Fri Jul 15 19:09:38 2016 +0300

----------------------------------------------------------------------
 .../mixins/wizard/assign_master_components.js   | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1cba6f45/ambari-web/app/mixins/wizard/assign_master_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js
index e7779c4..decafcc 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -121,6 +121,20 @@ App.AssignMasterComponents = Em.Mixin.create({
   markSavedComponentsAsInstalled: false,
 
   /**
+   * @type {boolean}
+   * @default false
+   */
+  validationInProgress: false,
+
+  /**
+   * run validation call which was skipped
+   * validation should be always ran after last change
+   * @type {boolean}
+   * @default false
+   */
+  runQueuedValidation: false,
+
+  /**
    * Array of <code>servicesMasters</code> objects, that will be shown on the
page
    * Are filtered using <code>mastersToShow</code>
    * @type {Array}
@@ -1134,6 +1148,13 @@ App.AssignMasterComponents = Em.Mixin.create({
   recommendAndValidate: function(callback) {
     var self = this;
 
+    if (this.get('validationInProgress')) {
+      this.set('runQueuedValidation', true);
+      return;
+    }
+
+    this.set('validationInProgress', true);
+
     // load recommendations with partial request
     self.loadComponentsRecommendationsFromServer(function() {
       // For validation use latest received recommendations because it contains current master
layout and recommended slave/client layout
@@ -1141,6 +1162,11 @@ App.AssignMasterComponents = Em.Mixin.create({
         if (callback) {
           callback();
         }
+        self.set('validationInProgress', false);
+        if (self.get('runQueuedValidation')) {
+          self.set('runQueuedValidation', false);
+          self.recommendAndValidate(callback);
+        }
       });
     }, true);
   },


Mime
View raw message