ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-19131. Manage Journalnode Wizard: incorrect number of installed JournalNodes (akovalenko)
Date Thu, 08 Dec 2016 11:04:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ba3e0869a -> a62a4f3b7


AMBARI-19131. Manage Journalnode Wizard: incorrect number of installed JournalNodes (akovalenko)


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

Branch: refs/heads/trunk
Commit: a62a4f3b7e0ebb25931ad99815360b462d4f9f80
Parents: ba3e086
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Wed Dec 7 21:12:48 2016 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Thu Dec 8 12:57:40 2016 +0200

----------------------------------------------------------------------
 .../journalNode/step1_controller.js             | 26 ++++++++++++--------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a62a4f3b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step1_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step1_controller.js
index b6ffe5b..e1252b7 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step1_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step1_controller.js
@@ -28,8 +28,6 @@ App.ManageJournalNodeWizardStep1Controller = Em.Controller.extend(App.BlueprintM
 
   mastersToShow: ['JOURNALNODE'],
 
-  mastersToAdd: [],
-
   showInstalledMastersFirst: true,
 
   JOURNALNODES_COUNT_MINIMUM: 3, // TODO get this from stack
@@ -41,14 +39,9 @@ App.ManageJournalNodeWizardStep1Controller = Em.Controller.extend(App.BlueprintM
    * @param masterComponents
    */
   renderComponents: function(masterComponents) {
-    var jns = App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE');
-    var count = jns.get('length');
-    this.set('mastersToAdd', []);
-    if (masterComponents.filterProperty('component_name', 'JOURNALNODE').length == 0) {
-      for (var i = 0; i < count; i++) {
-        this.get('mastersToAdd').push('JOURNALNODE');
-      }
-    }
+    //check if we are restoring components assignment by checking existing of JOURNALNODE
component in array
+    var restoringComponents = masterComponents.someProperty('component_name', 'JOURNALNODE');
+    masterComponents = restoringComponents ? masterComponents : masterComponents.concat(this.generateJournalNodeComponents());
     this._super(masterComponents);
     this.updateJournalNodeInfo();
     this.showHideJournalNodesAddRemoveControl();
@@ -56,6 +49,19 @@ App.ManageJournalNodeWizardStep1Controller = Em.Controller.extend(App.BlueprintM
   },
 
   /**
+   * Create JOURNALNODE components to add them to masters array
+   */
+  generateJournalNodeComponents: function () {
+    var journalNodes = [];
+    App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').forEach(function
(jn) {
+      var jnComponent = this.createComponentInstallationObject(Em.Object.create({serviceName:
jn.get('service.serviceName'), componentName: jn.get('componentName')}), jn.get('hostName'));
+      jnComponent.isInstalled = true;
+      journalNodes.push(jnComponent);
+    }, this);
+    return journalNodes;
+  },
+
+  /**
    * Enable/Disable show/hide operation for each JournalNode
    */
   showHideJournalNodesAddRemoveControl: function() {


Mime
View raw message