Author: yusaku
Date: Thu May 9 23:01:07 2013
New Revision: 1480832
URL: http://svn.apache.org/r1480832
Log:
AMBARI-2084. Wrong host mapping in Assign Masters step. (yusaku)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js
incubator/ambari/trunk/ambari-web/app/views/wizard/step5_view.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1480832&r1=1480831&r2=1480832&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu May 9 23:01:07 2013
@@ -837,6 +837,8 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-2084. Wrong host mapping in Assign Masters step. (yusaku)
+
AMBARI-2098. Customizing webcat pid run directory fails service status.
(swagle)
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js?rev=1480832&r1=1480831&r2=1480832&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js
(original)
+++
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js
Thu May 9 23:01:07 2013
@@ -125,6 +125,19 @@ App.WizardStep5Controller = Em.Controlle
}
}
this.set("hosts", result);
+ this.sortHosts(this.get('hosts'));
+ },
+
+ sortHosts: function (hosts) {
+ hosts.sort(function (a, b) {
+ if (a.get('memory') == b.get('memory')) {
+ if (a.get('cpu') == b.get('cpu')) {
+ return a.get('host_name').localeCompare(b.get('host_name')); //
hostname asc
+ }
+ return b.get('cpu') - a.get('cpu'); // cores desc
+ }
+ return b.get('memory') - a.get('memory'); // ram desc
+ });
},
/**
@@ -218,7 +231,7 @@ App.WizardStep5Controller = Em.Controlle
if (item.display_name === "ZooKeeper") {
componentObj.set('zId', zid++);
componentObj.set("showRemoveControl", showRemoveControlZk);
- } else if(App.supports.multipleHBaseMasters && item.component_name ===
"HBASE_MASTER"){
+ } else if (App.supports.multipleHBaseMasters && item.component_name ===
"HBASE_MASTER") {
componentObj.set('zId', hid++);
componentObj.set("showRemoveControl", showRemoveControlHb);
}
Modified: incubator/ambari/trunk/ambari-web/app/views/wizard/step5_view.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/wizard/step5_view.js?rev=1480832&r1=1480831&r2=1480832&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/wizard/step5_view.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/wizard/step5_view.js Thu May 9
23:01:07 2013
@@ -36,43 +36,11 @@ App.SelectHostView = Em.Select.extend({
componentName:null,
attributeBindings:['disabled'],
- filterContent:function () {
- this.get('content').sort(function (a, b) {
- if (a.get('memory') == b.get('memory')) {
- if (a.get('cpu') == b.get('cpu')) {
-
-// try to compare as ipaddresses
- if (a.get('host_name').ip2long() && b.get('host_name').ip2long()) {
- return a.get('host_name').ip2long() -
b.get('host_name').ip2long(); // hostname asc
- }
-
-// try to compare as strings
- if (a.get('host_name') > b.get('host_name')) {
- return 1;
- }
-
- if (b.get('host_name') > a.get('host_name')) {
- return -1;
- }
-
- return 0;
- }
- return b.get('cpu') - a.get('cpu'); // cores desc
- }
-
- return b.get('memory') - a.get('memory'); // ram desc
- });
-
- }.observes('content'),
-
change:function () {
this.get('controller').assignHostToMaster(this.get("componentName"),
this.get("value"), this.get("zId"));
},
didInsertElement:function () {
- if (!this.get('controller.isReassignWizard')) {
- this.filterContent();
- }
this.set("value", this.get("selectedHost"));
}
});