Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B036D200B45 for ; Fri, 15 Jul 2016 18:11:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AEC60160A61; Fri, 15 Jul 2016 16:11:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 01F90160A57 for ; Fri, 15 Jul 2016 18:11:17 +0200 (CEST) Received: (qmail 55943 invoked by uid 500); 15 Jul 2016 16:11:17 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 55934 invoked by uid 99); 15 Jul 2016 16:11:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2016 16:11:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D9E54E0A3F; Fri, 15 Jul 2016 16:11:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: atkach@apache.org To: commits@ambari.apache.org Message-Id: <09f9ade648cb4bdb9f1974eee27fb8fe@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-17737 Assign Masters: hosts change triggers too much validation calls. (atkach) Date: Fri, 15 Jul 2016 16:11:16 +0000 (UTC) archived-at: Fri, 15 Jul 2016 16:11:18 -0000 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 Authored: Fri Jul 15 16:52:12 2016 +0300 Committer: Andrii Tkach 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 servicesMasters objects, that will be shown on the page * Are filtered using mastersToShow * @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); },