This is an automated email from the ASF dual-hosted git repository.
akovalenko 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 35fe83c AMBARI-23166. NN Federation Wizard: implement step4
(akovalenko)
35fe83c is described below
commit 35fe83c4f720348dee3d00af53ce263686fd792e
Author: Aleksandr Kovalenko
AuthorDate: Wed Mar 7 18:17:36 2018 +0200
AMBARI-23166. NN Federation Wizard: implement step4 (akovalenko)
---
.../main/admin/federation/step3_controller.js | 9 +-
.../main/admin/federation/step4_controller.js | 101 -
.../main/admin/federation/wizard_controller.js | 18
.../data/configs/wizards/federation_properties.js | 52 ++-
ambari-web/app/messages.js | 15 +++
.../app/routes/namenode_federation_routes.js | 7 --
.../app/templates/main/admin/federation/step4.hbs | 7 +-
ambari-web/app/utils/ajax/ajax.js | 59
.../app/views/main/admin/federation/step4_view.js | 13 ++-
9 files changed, 241 insertions(+), 40 deletions(-)
diff --git
a/ambari-web/app/controllers/main/admin/federation/step3_controller.js
b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
index d48043b..993cecc 100644
--- a/ambari-web/app/controllers/main/admin/federation/step3_controller.js
+++ b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
@@ -81,13 +81,14 @@ App.NameNodeFederationWizardStep3Controller =
Em.Controller.extend(App.Blueprint
var ret = {};
var configsFromServer = this.get('serverConfigData.items');
var journalNodes =
App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE');
+var nameNodes =
this.get('content.masterComponentHosts').filterProperty('component',
'NAMENODE');
// todo: replace with real data
ret.nameservice1 = 'ns1';
ret.nameservice2 = this.get('content.nameServiceId');
-ret.namenode1 = this.get('content.selectedHosts.currentNN')[0];
-ret.namenode2 = this.get('content.selectedHosts.currentNN')[1];
-ret.namenode3 = this.get('content.selectedHosts.additionalNN')[0];
-ret.namenode4 = this.get('content.selectedHosts.additionalNN')[1];
+ret.namenode1 =
nameNodes.filterProperty('isInstalled').mapProperty('hostName')[0];
+ret.namenode2 =
nameNodes.filterProperty('isInstalled').mapProperty('hostName')[1];
+ret.namenode3 = nameNodes.filterProperty('isInstalled',
false).mapProperty('hostName')[0];
+ret.namenode4 = nameNodes.filterProperty('isInstalled',
false).mapProperty('hostName')[1];
ret.journalnodes = journalNodes.map(function (c) {
return c.get('hostName') + ':8485'
}).join(';');
diff --git
a/ambari-web/app/controllers/main/admin/federation/step4_controller.js
b/ambari-web/app/controllers/main/admin/federation/step4_controller.js
index 2a293a3..fd3a6f3 100644
--- a/ambari-web/app/controllers/main/admin/federation/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/federation/step4_controller.js
@@ -20,5 +20,104 @@ var App = require('app');
App.NameNodeFederationWizardStep4Controller =
App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
- name: "nameNodeFederationWizardStep4Controller"
+ name: "nameNodeFederationWizardStep4Controller",
+
+ commands: ['stopAllServices', 'reconfigureHDFS', 'installNameNode',
'installZKFC', 'formatNameNode', 'formatZKFC', 'startZKFC', 'startNameNode',
'bootstrapNameNode', 'startZKFC2', 'startNameNode2', 'startAllServices'],
+
+ tasksMessagesPrefix: 'admin.nameNodeFederation.wizard.step',
+
+ newNameNodeHosts: function () {
+return
this.get('content.masterComponentHosts').filterProperty('component',
'NAMENODE').filterProperty('isInstalled', false).mapProperty('hostName');
+ }.property('content.masterComponentHosts.@each.hostName'),
+
+ reconfigureHDFS: function () {
+var data = this.get('content.serviceConfigProperties');
+var note =
Em.I18n.t('admin.nameNodeFederation.wizard,step4.save.configuration.note');
+var configData = this.reconfigureSites(['hdfs-site'], data, note);
+return App.ajax.send({
+ name: 'common.service.configurations',
+ sender: this,
+ data: {
+desired_config: configData
+ },
+ error: 'onTaskError',
+ success: 'installHDFSClients'
+});
+ },
+
+ installHDFSClients: function () {
+var nnHostNames =
this.get('content.masterComponentHosts').filterProperty('component',
'NAMENODE').mapProperty('hostName');
+var jnHostNames = App.HostComponent.find().filterProperty('componentName',
'JOURNALNODE').mapProperty('hostName');
+var hostNames = nnHostNames.concat(jnHostNames).uniq();
+this.createInstallComponentTask('HDFS_CLIENT', hostNames, 'HDFS');
+ },
+
+ stopAllServices: function () {
+this.stopServices([], true,