You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2017/03/09 15:11:42 UTC
[1/2] ambari git commit: AMBARI-20377. Usability: Hostname hover of
master is not discoverable in Summary section (alexantonenko)
Repository: ambari
Updated Branches:
refs/heads/trunk fbcf24f71 -> 7ff9bd429
AMBARI-20377. Usability: Hostname hover of master is not discoverable in Summary section (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7ff9bd42
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7ff9bd42
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7ff9bd42
Branch: refs/heads/trunk
Commit: 7ff9bd429a1273074d6b8c1edf8b170d3f77ee0d
Parents: 647ff84
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Mar 9 15:00:54 2017 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Mar 9 17:11:37 2017 +0200
----------------------------------------------------------------------
.../service/info/summary/master_components.hbs | 2 +-
.../main/service/info/components_list_view.js | 23 ++++++-----
ambari-web/app/views/main/service/service.js | 12 ++----
.../app/views/main/service/services/hdfs.js | 17 +++------
.../service/info/component_list_view_test.js | 29 ++++++--------
.../views/main/service/services/hdfs_test.js | 40 +++-----------------
6 files changed, 40 insertions(+), 83 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ff9bd42/ambari-web/app/templates/main/service/info/summary/master_components.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/master_components.hbs b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
index be388c5..5b7b47b 100644
--- a/ambari-web/app/templates/main/service/info/summary/master_components.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
@@ -19,7 +19,7 @@
{{#each comp in view.mastersComp}}
<div {{bindAttr class="comp.isSubComponent:component-small :component comp.componentName :row"}}>
<div {{bindAttr class=":col-md-6 :summary-label comp.summaryLabelClassName"}}>
- <a href="#" {{action showDetails comp.host}} title="{{unbound comp.publicHostName}}" rel="UsageTooltip">
+ <a href="#" {{action showDetails comp.host}} data-original-title="{{unbound comp.publicHostName}}" rel="UsageTooltip">
{{#if comp.displayNameAdvanced}}
{{comp.displayNameAdvanced}}
{{else}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ff9bd42/ambari-web/app/views/main/service/info/components_list_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/components_list_view.js b/ambari-web/app/views/main/service/info/components_list_view.js
index c0a9922..2d01d83 100644
--- a/ambari-web/app/views/main/service/info/components_list_view.js
+++ b/ambari-web/app/views/main/service/info/components_list_view.js
@@ -20,25 +20,24 @@ var App = require('app');
App.SummaryMasterComponentsView = Em.View.extend({
templateName: require('templates/main/service/info/summary/master_components'),
- mastersCurrentLength: 0,
+
mastersComp: [],
+
mastersCompWillChange: function() {
- this.removeTooltips();
+ Em.run.next(() => this.removeTooltips());
}.observesBefore('mastersComp.length'),
+
mastersCompDidChange: function() {
- this.attachTooltip();
+ Em.run.next(() => this.attachTooltip());
}.observes('mastersComp.length'),
removeTooltips: function() {
- if ($('[rel=SummaryComponentHealthTooltip]').length) {
- $('[rel=SummaryComponentHealthTooltip]').tooltip('destroy');
- }
+ $('.tooltip').remove();
+ $(App.SummaryMasterComponentsView.tooltipsSelector).tooltip('destroy');
},
attachTooltip: function() {
- if ($('[rel=SummaryComponentHealthTooltip]').length) {
- App.tooltip($('[rel=SummaryComponentHealthTooltip]'));
- }
+ App.tooltip($(App.SummaryMasterComponentsView.tooltipsSelector));
},
didInsertElement: function() {
@@ -46,10 +45,14 @@ App.SummaryMasterComponentsView = Em.View.extend({
},
willDestroyElement: function() {
- $('[rel=SummaryComponentHealthTooltip]').tooltip('destroy');
+ this.removeTooltips();
}
});
+App.SummaryMasterComponentsView.reopenClass({
+ tooltipsSelector: '[rel=SummaryComponentHealthTooltip], [rel=UsageTooltip]'
+});
+
App.SummaryClientComponentsView = Em.View.extend({
templateName: require('templates/main/service/info/summary/client_components'),
clientsObj: []
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ff9bd42/ambari-web/app/views/main/service/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/service.js b/ambari-web/app/views/main/service/service.js
index 466ccdc..74319f5 100644
--- a/ambari-web/app/views/main/service/service.js
+++ b/ambari-web/app/views/main/service/service.js
@@ -19,6 +19,7 @@
var App = require('app');
var uiEffects = require('utils/ui_effects');
var numberUtils = require('utils/number_utils');
+require('views/main/service/info/components_list_view');
App.MainDashboardServiceHealthView = Em.View.extend({
classNameBindings: ["healthStatus", "healthStatusClass"],
@@ -131,15 +132,8 @@ App.MainDashboardServiceView = Em.View.extend(App.MainDashboardServiceViewWrappe
return this.get('controller.data.' + this.get('serviceName'));
}.property('controller.data'),
- dashboardMasterComponentView: Em.View.extend({
- didInsertElement: function() {
- App.tooltip($('[rel=SummaryComponentHealthTooltip]'));
- },
- templateName: require('templates/main/service/info/summary/master_components'),
- mastersComp: Em.computed.alias('parentView.parentView.mastersObj'),
- willDestroyElement: function() {
- $('[rel=SummaryComponentHealthTooltip]').tooltip('destroy');
- }
+ dashboardMasterComponentView: App.SummaryMasterComponentsView.extend({
+ mastersComp: Em.computed.alias('parentView.parentView.mastersObj')
}),
alertsCount: Em.computed.alias('service.alertsCount'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ff9bd42/ambari-web/app/views/main/service/services/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/hdfs.js b/ambari-web/app/views/main/service/services/hdfs.js
index f85e095..79208b9 100644
--- a/ambari-web/app/views/main/service/services/hdfs.js
+++ b/ambari-web/app/views/main/service/services/hdfs.js
@@ -49,16 +49,13 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
}.property('service.capacityUsed', 'service.capacityTotal')
}),
- dashboardMasterComponentView: Em.View.extend({
- didInsertElement: function() {
- App.tooltip($('[rel=healthTooltip]'));
- },
- templateName: require('templates/main/service/info/summary/master_components'),
+ dashboardMasterComponentView: App.SummaryMasterComponentsView.extend({
mastersComp: function() {
var masterComponents = [];
- var zkfcs = this.get('parentView.service.hostComponents').filterProperty('componentName', 'ZKFC');
+ var hostComponents = this.get('parentView.service.hostComponents');
+ var zkfcs = hostComponents.filterProperty('componentName', 'ZKFC');
- this.get('parentView.service.hostComponents').forEach(function (comp) {
+ hostComponents.forEach(function (comp) {
if (comp.get('isMaster') && comp.get('componentName') !== 'JOURNALNODE') {
masterComponents.push(comp);
var zkfc = zkfcs.findProperty('hostName', comp.get('hostName'));
@@ -69,10 +66,8 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
}
});
return masterComponents;
- }.property('parentView.service.hostComponents.length'),
- willDestroyElement: function() {
- $('[rel=healthTooltip]').tooltip('destroy')
- }
+ }.property('parentView.service.hostComponents.length')
+
}),
metricsNotAvailableObserver: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ff9bd42/ambari-web/test/views/main/service/info/component_list_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/info/component_list_view_test.js b/ambari-web/test/views/main/service/info/component_list_view_test.js
index 1537f2b..af7d7e8 100644
--- a/ambari-web/test/views/main/service/info/component_list_view_test.js
+++ b/ambari-web/test/views/main/service/info/component_list_view_test.js
@@ -33,9 +33,11 @@ describe('App.SummaryMasterComponentsView', function () {
describe("#mastersCompWillChange", function() {
beforeEach(function() {
+ sinon.stub(Em.run, 'next', Em.clb);
sinon.stub(view, 'removeTooltips');
});
afterEach(function() {
+ Em.run.next.restore();
view.removeTooltips.restore();
});
@@ -48,9 +50,11 @@ describe('App.SummaryMasterComponentsView', function () {
describe("#mastersCompDidChange", function() {
beforeEach(function() {
+ sinon.stub(Em.run, 'next', Em.clb);
sinon.stub(view, 'attachTooltip');
});
afterEach(function() {
+ Em.run.next.restore();
view.attachTooltip.restore();
});
@@ -76,7 +80,10 @@ describe('App.SummaryMasterComponentsView', function () {
});
describe("#willDestroyElement", function() {
- var mock = {tooltip: Em.K};
+ var mock = {
+ tooltip: Em.K,
+ remove: Em.K
+ };
beforeEach(function() {
sinon.spy(mock, 'tooltip');
@@ -95,7 +102,8 @@ describe('App.SummaryMasterComponentsView', function () {
describe("#removeTooltips", function() {
var mock = {
- tooltip: Em.K
+ tooltip: Em.K,
+ remove: Em.K
};
beforeEach(function() {
@@ -108,21 +116,15 @@ describe('App.SummaryMasterComponentsView', function () {
});
it("tooltip should be called", function() {
- mock.length = 1;
view.removeTooltips();
expect(mock.tooltip.calledWith('destroy')).to.be.true;
});
-
- it("tooltip should not be called", function() {
- mock.length = 0;
- view.removeTooltips();
- expect(mock.tooltip.called).to.be.false;
- });
});
describe("#attachTooltip", function() {
var mock = {
- tooltip: Em.K
+ tooltip: Em.K,
+ remove: Em.K
};
beforeEach(function() {
@@ -135,16 +137,9 @@ describe('App.SummaryMasterComponentsView', function () {
});
it("tooltip should be called", function() {
- mock.length = 1;
view.attachTooltip();
expect(App.tooltip.calledOnce).to.be.true;
});
-
- it("tooltip should not be called", function() {
- mock.length = 0;
- view.attachTooltip();
- expect(App.tooltip.called).to.be.false;
- });
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ff9bd42/ambari-web/test/views/main/service/services/hdfs_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/services/hdfs_test.js b/ambari-web/test/views/main/service/services/hdfs_test.js
index efa0e3b..4de5f0b 100644
--- a/ambari-web/test/views/main/service/services/hdfs_test.js
+++ b/ambari-web/test/views/main/service/services/hdfs_test.js
@@ -60,7 +60,11 @@ describe('App.MainDashboardServiceHdfsView', function () {
beforeEach(function() {
dashboardMasterComponentView = view.get('dashboardMasterComponentView').create({
- parentView: Em.Object.create()
+ parentView: Em.Object.create({
+ service: Em.Object.create({
+ hostComponents: []
+ })
+ })
});
});
@@ -88,40 +92,6 @@ describe('App.MainDashboardServiceHdfsView', function () {
});
});
- describe("#didInsertElement()", function() {
-
- beforeEach(function() {
- sinon.stub(App, 'tooltip');
- });
- afterEach(function() {
- App.tooltip.restore();
- });
-
- it("App.tooltip should be called", function() {
- dashboardMasterComponentView.didInsertElement();
- expect(App.tooltip.calledOnce).to.be.true;
- });
- });
-
- describe("#willDestroyElement()", function() {
- var mock = {
- tooltip: Em.K
- };
-
- beforeEach(function() {
- sinon.stub(mock, 'tooltip');
- sinon.stub(window, '$').returns(mock);
- });
- afterEach(function() {
- mock.tooltip.restore();
- window.$.restore();
- });
-
- it("tooltip destroy should be called", function() {
- dashboardMasterComponentView.willDestroyElement();
- expect(mock.tooltip.calledWith('destroy')).to.be.true;
- });
- });
});
describe("#metricsNotAvailableObserver()", function() {
[2/2] ambari git commit: AMBARI-20376. While Moving Namenode via Move
Master wizard, datanodes reported as down (alexantonenko)
Posted by al...@apache.org.
AMBARI-20376. While Moving Namenode via Move Master wizard, datanodes reported as down (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/647ff84b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/647ff84b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/647ff84b
Branch: refs/heads/trunk
Commit: 647ff84b0b85b04bd350ddb268fde56b0778cf2b
Parents: fbcf24f
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Mar 9 14:32:10 2017 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Mar 9 17:11:37 2017 +0200
----------------------------------------------------------------------
.../controllers/main/service/reassign/step6_controller.js | 9 +++++++++
ambari-web/app/messages.js | 1 +
.../app/mixins/wizard/wizardProgressPageController.js | 6 +++---
3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/647ff84b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step6_controller.js b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
index 80f1bf6..05494d4 100644
--- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
@@ -27,6 +27,7 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
'putHostComponentsInMaintenanceMode',
'stopHostComponentsInMaintenanceMode',
'deleteHostComponents',
+ 'startDatanodes',
'startAllServices'
],
@@ -97,6 +98,9 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
} else {
this.removeTasks(['stopHostComponentsInMaintenanceMode']);
}
+ if (!(this.get('content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled'))) {
+ this.removeTasks(['startDatanodes']);
+ }
},
hideRollbackButton: function () {
@@ -200,5 +204,10 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
success: 'startPolling',
error: 'onTaskError'
});
+ },
+
+ startDatanodes: function () {
+ this.updateComponent('DATANODE', null, 'HDFS', 'Start');
}
+
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/647ff84b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index a0bc119..2e80a2b 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2429,6 +2429,7 @@ Em.I18n.translations = {
'services.reassign.step6.tasks.installPxf.title': 'Install PXF on NameNode',
'services.reassign.step6.tasks.stopMysqlService.title': 'Stop Mysql Server',
'services.reassign.step6.tasks.stopHostComponentsInMaintenanceMode.title': 'Stop {0}',
+ 'services.reassign.step6.tasks.startDatanodes.title': 'Start DataNodes',
'services.reassign.step6.status.success': 'Successfully moved <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host.',
'services.reassign.step6.status.failed': 'Failed to move <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host.',
'services.reassign.step6.status.info': 'Reassigning {0}. \nPlease wait for all tasks to be completed.',
http://git-wip-us.apache.org/repos/asf/ambari/blob/647ff84b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
index ced5591..9d9d000 100644
--- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js
+++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
@@ -604,14 +604,14 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, {
* Update component status on selected hosts.
*
* @param {string} componentName
- * @param {(string|string[])} hostName
+ * @param {(string|string[]|null)} hostName - use null to update components on all hosts
* @param {string} serviceName
* @param {string} context
* @param {number} taskNum
* @returns {$.ajax}
*/
updateComponent: function (componentName, hostName, serviceName, context, taskNum) {
- if (!(hostName instanceof Array)) {
+ if (hostName && !(hostName instanceof Array)) {
hostName = [hostName];
}
var state = context.toLowerCase() == "start" ? "STARTED" : "INSTALLED";
@@ -622,7 +622,7 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, {
HostRoles: {
state: state
},
- query: 'HostRoles/component_name=' + componentName + '&HostRoles/host_name.in(' + hostName.join(',') + ')&HostRoles/maintenance_state=OFF',
+ query: 'HostRoles/component_name=' + componentName + (hostName ? '&HostRoles/host_name.in(' + hostName.join(',') + ')' : '') + '&HostRoles/maintenance_state=OFF',
context: context + " " + App.format.role(componentName, false),
hostName: hostName,
taskNum: taskNum || 1,