This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 40aac82  [AMBARI-24452] [UI Deploy] LLAP queue is not created/set in 
YARN conf… (#2016)
40aac82 is described below

commit 40aac8240bb516cf1048afd0642e1e7d6dc2027f
Author: Ishan Bhatt <ishanbhatt.1...@gmail.com>
AuthorDate: Thu Aug 9 17:12:07 2018 -0700

    [AMBARI-24452] [UI Deploy] LLAP queue is not created/set in YARN conf… 
(#2016)
    
    * [AMBARI-24452] [UI Deploy] LLAP queue is not created/set in YARN configs 
while enabling HSI.
    
    * Changed function parameters info
---
 .../common/configs/config_recommendation_parser.js | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git 
a/ambari-web/app/mixins/common/configs/config_recommendation_parser.js 
b/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
index 74aeacd..19ea8a5 100644
--- a/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
+++ b/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
@@ -169,9 +169,15 @@ App.ConfigRecommendationParser = 
Em.Mixin.create(App.ConfigRecommendations, {
           allowConfigUpdate = false;
         }
       }
+
       if (prevRecommeneded !== value) {
         allowConfigUpdate = false;
       }
+
+      if (name === "capacity-scheduler") {
+        allowConfigUpdate = 
this.compareCapacitySchedulerValues(prevRecommeneded, value);
+      }
+
       if (allowConfigUpdate) {
         Em.setProperties(config, {
           value: recommendedValue,
@@ -192,6 +198,45 @@ App.ConfigRecommendationParser = 
Em.Mixin.create(App.ConfigRecommendations, {
   },
 
   /**
+   * Configs with value across multiple lines could have them in a different 
order
+   * Eg: capacity-scheduler
+   *
+   * @param {String} prevRec
+   * @param {String} value
+   * @returns {Boolean}
+   * @method isPrevRecAndValueEqual
+   */
+
+  compareCapacitySchedulerValues: function (prevRec, value) {
+
+
+    let prevRecArr = prevRec.split("\n");
+    let valueArr = value.split("\n");
+
+    //first value being added is capacity-scheduler=null. Remove that for 
comparison
+    if (valueArr[0].includes("capacity-scheduler")) {
+      valueArr = valueArr.splice(1);
+    }
+
+    if (prevRecArr.length !== valueArr.length) {
+      return false;
+    }
+    if (prevRecArr.length < 2 || valueArr.length < 2) {
+      return prevRec === value;
+    }
+    let strMap = {};
+    for (var i=0; i <prevRecArr.length; i++) {
+      strMap[prevRecArr[i]] = true;
+    }
+    for (var i=0; i<valueArr.length; i++) {
+      if (!strMap[valueArr[i]]) {
+        return false;
+      }
+    }
+    return true;
+  },
+
+  /**
    * Add config based on recommendations
    *
    * @param name

Reply via email to