You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2018/05/17 14:38:14 UTC
[ambari] branch trunk updated: AMBARI-23879 Redo the Manage
Journalnodes wizard in the context of federation changes. (ababiichuk)
This is an automated email from the ASF dual-hosted git repository.
ababiichuk 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 9671dd1 AMBARI-23879 Redo the Manage Journalnodes wizard in the context of federation changes. (ababiichuk)
9671dd1 is described below
commit 9671dd17d83d39589cb05e830ecaffcf2a025086
Author: aBabiichuk <ab...@hortonworks.com>
AuthorDate: Thu May 17 17:38:09 2018 +0300
AMBARI-23879 Redo the Manage Journalnodes wizard in the context of federation changes. (ababiichuk)
---
ambari-web/app/assets/test/tests.js | 1 -
ambari-web/app/controllers.js | 1 -
.../journalNode/step1_controller.js | 12 +++++
.../journalNode/step4_controller.js | 7 +--
.../journalNode/step5_controller.js | 11 +++-
.../journalNode/step6_controller.js | 13 ++---
.../journalNode/step7_controller.js | 13 ++---
.../journalNode/step8_controller.js | 35 -------------
.../journalNode/wizard_controller.js | 2 +-
ambari-web/app/messages.js | 47 +++++------------
ambari-web/app/routes/manage_journalnode_routes.js | 24 +--------
.../admin/highAvailability/journalNode/step3.hbs | 8 +--
.../admin/highAvailability/journalNode/step5.hbs | 13 +++--
.../admin/highAvailability/journalNode/step7.hbs | 12 +----
.../admin/highAvailability/journalNode/step8.hbs | 18 -------
.../admin/highAvailability/journalNode/wizard.hbs | 5 +-
ambari-web/app/views.js | 1 -
.../highAvailability/journalNode/step5_view.js | 33 +++++-------
.../highAvailability/journalNode/step7_view.js | 9 ++--
.../highAvailability/journalNode/step8_view.js | 29 ----------
.../journalNode/step4_controller_test.js | 22 --------
.../journalNode/step6_controller_test.js | 55 +++++++------------
.../journalNode/step7_controller_test.js | 14 +++--
.../journalNode/step8_controller_test.js | 61 ----------------------
24 files changed, 107 insertions(+), 339 deletions(-)
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 482f046..b8c34de 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -94,7 +94,6 @@ var files = [
'test/controllers/main/admin/highAvailability/journalNode/step4_controller_test',
'test/controllers/main/admin/highAvailability/journalNode/step6_controller_test',
'test/controllers/main/admin/highAvailability/journalNode/step7_controller_test',
- 'test/controllers/main/admin/highAvailability/journalNode/step8_controller_test',
'test/controllers/main/admin/highAvailability/journalNode/wizard_controller_test',
'test/controllers/main/admin/highAvailability/rangerAdmin/step3_controller_test',
'test/controllers/main/dashboard/config_history_controller_test',
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index c68d306..bd858a5 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -88,7 +88,6 @@ require('controllers/main/admin/highAvailability/journalNode/step4_controller');
require('controllers/main/admin/highAvailability/journalNode/step5_controller');
require('controllers/main/admin/highAvailability/journalNode/step6_controller');
require('controllers/main/admin/highAvailability/journalNode/step7_controller');
-require('controllers/main/admin/highAvailability/journalNode/step8_controller');
require('controllers/main/admin/stack_and_upgrade_controller');
require('controllers/main/admin/stack_upgrade_history_controller');
require('controllers/main/admin/serviceAccounts_controller');
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 197596c..8f914cd 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
@@ -65,6 +65,18 @@ App.ManageJournalNodeWizardStep1Controller = Em.Controller.extend(App.BlueprintM
},
/**
+ * Override of method from <code>App.AssignMasterComponents</code>
+ * Added to satisfy the requirement that maximum number of new JournalNodes to be added
+ * should be 1 less that total of the existing JournalNodes
+ * @returns {number}
+ */
+ getMaxNumberOfMasters: function () {
+ const defaultLimitation = this._super('JOURNALNODE'),
+ installedJournalNodesCount = App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').length;
+ return Math.min(defaultLimitation, installedJournalNodesCount * 2 - 1);
+ },
+
+ /**
* Enable/Disable show/hide operation for each JournalNode
*/
showHideJournalNodesAddRemoveControl: function () {
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step4_controller.js
index fad2b3d..fc87716 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step4_controller.js
@@ -23,7 +23,7 @@ App.ManageJournalNodeWizardStep4Controller = App.ManageJournalNodeProgressPageCo
clusterDeployState: 'JOURNALNODE_MANAGEMENT',
tasksMessagesPrefix: 'admin.manageJournalNode.wizard.step',
- commands: ['stopStandbyNameNode', 'stopAllServices', 'installJournalNodes', 'deleteJournalNodes', 'startJournalNodes', 'reconfigureHDFS'],
+ commands: ['stopStandbyNameNode', 'stopAllServices', 'installJournalNodes', 'deleteJournalNodes', 'reconfigureHDFS'],
hdfsSiteTag: "",
@@ -57,11 +57,6 @@ App.ManageJournalNodeWizardStep4Controller = App.ManageJournalNodeProgressPageCo
}
},
- startJournalNodes: function () {
- var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
- this.updateComponent('JOURNALNODE', hostNames, "HDFS", "Start");
- },
-
reconfigureHDFS: function () {
this.updateConfigProperties(this.get('content.serviceConfigProperties'));
},
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step5_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step5_controller.js
index 2329dee..530c9f6 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step5_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step5_controller.js
@@ -18,6 +18,13 @@
var App = require('app');
-App.ManageJournalNodeWizardStep5Controller = App.HighAvailabilityWizardStep6Controller.extend({
- name : 'manageJournalNodeWizardStep5Controller'
+App.ManageJournalNodeWizardStep5Controller = Em.Controller.extend({
+ name: 'manageJournalNodeWizardStep5Controller',
+ isHDFSNameSpacesLoaded: Em.computed.alias('App.router.clusterController.isHDFSNameSpacesLoaded'),
+ isNextEnabled: Em.computed.alias('isHDFSNameSpacesLoaded'),
+ done: function () {
+ if (this.get('isNextEnabled')) {
+ App.router.send('next');
+ }
+ }
});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step6_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step6_controller.js
index 288d1c6..991b881 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step6_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step6_controller.js
@@ -23,15 +23,10 @@ App.ManageJournalNodeWizardStep6Controller = App.ManageJournalNodeProgressPageCo
clusterDeployState: 'JOURNALNODE_MANAGEMENT',
tasksMessagesPrefix: 'admin.manageJournalNode.wizard.step',
- commands: ['startZooKeeperServers', 'startActiveNameNode'],
+ commands: ['startJournalNodes'],
- startZooKeeperServers: function () {
- var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
- this.updateComponent('ZOOKEEPER_SERVER', hostNames, "ZOOKEEPER", "Start");
- },
-
- startActiveNameNode: function () {
- var hostName = this.get('content.activeNN.host_name');
- this.updateComponent('NAMENODE', hostName, "HDFS", "Start");
+ startJournalNodes: function () {
+ const hostNames = App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').mapProperty('hostName');
+ this.updateComponent('JOURNALNODE', hostNames, 'HDFS', 'Start');
}
});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step7_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step7_controller.js
index 0467ce9..081b062 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step7_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step7_controller.js
@@ -18,13 +18,14 @@
var App = require('app');
-App.ManageJournalNodeWizardStep7Controller = Em.Controller.extend({
+App.ManageJournalNodeWizardStep7Controller = App.ManageJournalNodeProgressPageController.extend(App.WizardEnableDone, {
+ name: 'manageJournalNodeWizardStep7Controller',
+ clusterDeployState: 'JOURNALNODE_MANAGEMENT',
+ tasksMessagesPrefix: 'admin.manageJournalNode.wizard.step',
- name: "manageJournalNodeWizardStep7Controller",
+ commands: ['startAllServices'],
- done: function () {
- App.router.send("next");
+ startAllServices: function () {
+ this.startServices(false);
}
-
});
-
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step8_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step8_controller.js
deleted file mode 100644
index 5550732..0000000
--- a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/step8_controller.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.ManageJournalNodeWizardStep8Controller = App.ManageJournalNodeProgressPageController.extend(App.WizardEnableDone, {
- name: 'manageJournalNodeWizardStep8Controller',
- clusterDeployState: 'JOURNALNODE_MANAGEMENT',
- tasksMessagesPrefix: 'admin.manageJournalNode.wizard.step',
-
- commands: ['stopHDFS', 'startAllServices'],
-
- stopHDFS: function () {
- this.stopServices(["HDFS"], true);
- },
-
- startAllServices: function () {
- this.startServices(false);
- }
-});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/wizard_controller.js
index 77472bc..4dae3b3 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/journalNode/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/journalNode/wizard_controller.js
@@ -23,7 +23,7 @@ App.ManageJournalNodeWizardController = App.WizardController.extend({
name: 'manageJournalNodeWizardController',
- totalSteps: 8,
+ totalSteps: 7,
/**
* Used for hiding back button in wizard
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index e35a264..532766c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1372,10 +1372,9 @@ Em.I18n.translations = {
'admin.manageJournalNode.wizard.step2.header': 'Review',
'admin.manageJournalNode.wizard.step3.header': 'Save Namespace',
'admin.manageJournalNode.wizard.step4.header': 'Add/Remove JournalNodes',
- 'admin.manageJournalNode.wizard.step5.header': 'Format JournalNodes',
- 'admin.manageJournalNode.wizard.step6.header': 'Start Active NameNode',
- 'admin.manageJournalNode.wizard.step7.header': 'BootStrap Standby NameNode',
- 'admin.manageJournalNode.wizard.step8.header': 'Start All Services',
+ 'admin.manageJournalNode.wizard.step5.header': 'Copy JournalNode directories',
+ 'admin.manageJournalNode.wizard.step6.header': 'Start JournalNodes',
+ 'admin.manageJournalNode.wizard.step7.header': 'Start All Services',
'admin.manageJournalNode.wizard.step1.body': 'Add, or Remove JournalNodes',
'admin.manageJournalNode.wizard.step3.confirm.hosts.body': '<b>Confirm your host selections.</b>',
@@ -1386,25 +1385,21 @@ Em.I18n.translations = {
'admin.manageJournalNode.wizard.step4.task1.title': 'Stop Services',
'admin.manageJournalNode.wizard.step4.task2.title': 'Add JournalNodes',
'admin.manageJournalNode.wizard.step4.task3.title': 'Delete JournalNodes',
- 'admin.manageJournalNode.wizard.step4.task4.title': 'Start JournalNodes',
- 'admin.manageJournalNode.wizard.step4.task5.title': 'Reconfigure HDFS',
- 'admin.manageJournalNode.wizard.step6.task0.title': 'Start Zookeeper Server',
- 'admin.manageJournalNode.wizard.step6.task1.title': 'Start Active NameNode',
- 'admin.manageJournalNode.wizard.step8.task0.title': 'Stop HDFS',
- 'admin.manageJournalNode.wizard.step8.task1.title': 'Start All Services',
+ 'admin.manageJournalNode.wizard.step4.task4.title': 'Reconfigure HDFS',
+ 'admin.manageJournalNode.wizard.step6.task0.title': 'Start JournalNodes',
+ 'admin.manageJournalNode.wizard.step7.task0.title': 'Start All Services',
- 'admin.manageJournalNode.wizard.step5.bodyHeader': 'Manual Steps Required: Format JournalNodes',
- 'admin.manageJournalNode.wizard.step7.bodyHeader': 'Manual Steps Required: BootStrap Standby NameNode',
+ 'admin.manageJournalNode.wizard.step5.bodyHeader': 'Manual Steps Required: Copy JournalNode directories',
'admin.manageJournalNode.step4.save.configuration.note' : 'This configuration is created by Manage JournalNode Wizard',
- 'admin.manageJournalNode.wizard.step8.notice.inProgress': 'Please wait while services are started',
'admin.manageJournalNode.wizard.progressPage.notice.inProgress': 'Please wait while JournalNodes are being deployed',
- 'admin.manageJournalNode.wizard.step6.notice.inProgress': 'Please wait for related services to be started',
'admin.manageJournalNode.wizard.step4.notice.inProgress': 'Please wait while JournalNodes are being deployed',
- 'admin.manageJournalNode.wizard.step8.notice.completed':'Completed update to JournalNodes.',
+ 'admin.manageJournalNode.wizard.step6.notice.inProgress': 'Please wait while JournalNodes are started',
+ 'admin.manageJournalNode.wizard.step7.notice.inProgress': 'Please wait while services are started',
+ 'admin.manageJournalNode.wizard.step7.notice.completed':'Completed update to JournalNodes.',
'admin.manageJournalNode.wizard.step3.body':
'<ol>' +
@@ -1419,27 +1414,11 @@ Em.I18n.translations = {
'admin.manageJournalNode.wizard.step5.body':
'<ol>' +
- '<li>Login to the NameNode host <b>{1}</b>.</li>' +
- '<li>Initialize the JournalNodes by running:' +
- '<div class="code-snippet">sudo su {0} -l -c \'hdfs namenode -initializeSharedEdits\'</div></li>' +
- '<li>You will be able to proceed once Ambari detects that the JournalNodes have been initialized successfully.</li>' +
+ '<li>Login to the JournalNode host <b>{0}</b>.</li>' +
+ '<li>Create a tarball of the Journal directories: {1}.</li>' +
+ '<li>Copy the tarball on the new JournalNodes and untar at the respective locations as in Step 2.</li>' +
'</ol>',
- 'admin.manageJournalNode.wizard.step7.body':
- '<div class="alert alert-info">' +
- '<ol start="1">' +
- '<li>Login to the Additional NameNode host <b>{1}</b>.<br>' +
- '<div class="alert alert-warn"><strong>Important!</strong> Be sure to login to the Additional NameNode host.<br>This is a different host from previous steps.</div>' +
- '</li>' +
- '<li>Initialize the metadata for the Additional NameNode by running:' +
- '<div class="code-snippet">sudo su {0} -l -c \'hdfs namenode -bootstrapStandby\'</div></li>' +
- '</ol>' +
- '</div>' +
- 'Please proceed once you have completed the steps above.',
-
-
-
-
'admin.highAvailability':' High Availability',
'admin.highAvailability.button.enable':'Enable NameNode HA',
'admin.highAvailability.button.disable':'Disable NameNode HA',
diff --git a/ambari-web/app/routes/manage_journalnode_routes.js b/ambari-web/app/routes/manage_journalnode_routes.js
index 16e019a..ae119f4 100644
--- a/ambari-web/app/routes/manage_journalnode_routes.js
+++ b/ambari-web/app/routes/manage_journalnode_routes.js
@@ -172,7 +172,7 @@ module.exports = App.WizardRoute.extend({
var controller = router.get('manageJournalNodeWizardController');
controller.clearTasksData();
if (controller.get('isDeleteOnly')) {
- router.transitionTo('step8');
+ router.transitionTo('step6');
} else {
router.transitionTo('step5');
}
@@ -200,7 +200,7 @@ module.exports = App.WizardRoute.extend({
}),
step6: Em.Route.extend({
- route: '/step5',
+ route: '/step6',
connectOutlets: function (router) {
var controller = router.get('manageJournalNodeWizardController');
controller.dataLoading().done(function () {
@@ -237,26 +237,6 @@ module.exports = App.WizardRoute.extend({
return false;
},
next: function (router) {
- router.transitionTo('step8');
- }
- }),
-
- step8: Em.Route.extend({
- route: '/step8',
- connectOutlets: function (router) {
- var controller = router.get('manageJournalNodeWizardController');
- controller.dataLoading().done(function () {
- controller.setCurrentStep('8');
- controller.setLowerStepsDisable(8);
- controller.loadAllPriorSteps().done(function () {
- controller.connectOutlet('manageJournalNodeWizardStep8', controller.get('content'));
- });
- })
- },
- unroutePath: function () {
- return false;
- },
- next: function (router) {
var controller = router.get('manageJournalNodeWizardController');
controller.clearTasksData();
controller.resetOnClose(controller, 'main.services.index');
diff --git a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step3.hbs b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step3.hbs
index e105e11..2c1125b 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step3.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step3.hbs
@@ -22,9 +22,11 @@
{{t admin.highAvailability.wizard.step4.error.nameNode}}
</p>
{{/unless}}
- <p class="step-description">
- {{{view.step3BodyText}}}
- </p>
+ <div class="panel panel-default">
+ <div class="panel-body">
+ {{{view.step3BodyText}}}
+ </div>
+ </div>
</div>
<div class="wizard-footer col-md-12">
diff --git a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step5.hbs b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step5.hbs
index 2b1e0d2..da51850 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step5.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step5.hbs
@@ -17,13 +17,18 @@
}}
<div id="manage-journal-node-step5" class="wizard-content col-md-9">
<h4 class="step-title">{{t admin.manageJournalNode.wizard.step5.bodyHeader}}</h4>
- <p class="step-description">
- {{{view.step5BodyText}}}
- </p>
+ <div class="panel panel-default">
+ <div class="panel-body">
+ {{#if controller.isHDFSNameSpacesLoaded}}
+ {{{view.step5BodyText}}}
+ {{else}}
+ {{view App.SpinnerView}}
+ {{/if}}
+ </div>
+ </div>
</div>
<div class="wizard-footer col-md-12">
<div class="btn-area">
<a {{bindAttr class="controller.isNextEnabled::disabled :btn :btn-success :pull-right"}} {{action done target="controller"}}>{{t common.next}} →</a>
- <span class="pull-right btn-extra-info">{{view.jnCheckPointText}}</span>
</div>
</div>
diff --git a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs
index 1c96c81..08dc3b9 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step7.hbs
@@ -15,14 +15,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
}}
-<div id="manage-journal-node-step7" class="wizard-content col-md-9">
- <h4 class="step-title">{{t admin.manageJournalNode.wizard.step7.bodyHeader}}</h4>
- <p class="step-description">
- {{{view.step7BodyText}}}
- </p>
-</div>
-<div class="wizard-footer col-md-12">
- <div class="btn-area">
- <a class="btn btn-success pull-right" {{action done target="controller"}}>{{t common.next}} →</a>
- </div>
-</div>
+{{template "templates/common/progress"}}
diff --git a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step8.hbs b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step8.hbs
deleted file mode 100644
index 1877342..0000000
--- a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step8.hbs
+++ /dev/null
@@ -1,18 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-{{template "templates/common/progress"}}
\ No newline at end of file
diff --git a/ambari-web/app/templates/main/admin/highAvailability/journalNode/wizard.hbs b/ambari-web/app/templates/main/admin/highAvailability/journalNode/wizard.hbs
index a4c2155..ce7c092 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/journalNode/wizard.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/journalNode/wizard.hbs
@@ -25,9 +25,8 @@
<li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled view.isStep3Completed:completed isDeleteOnly:hidden"}}><a href="javascript:void(null);" {{action gotoStep3 target="controller"}}><i class="step-marker"><span class="step-index">3</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step3.header}}</p></a></li>
<li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled view.isStep4Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep4 target="controller"}}><i class="step-marker"><span class="step-index">{{#if isDeleteOnly}}3{{else}}4{{/if}}</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step4.header}}</p></a></li>
<li {{bindAttr class="isStep5:active view.isStep5Disabled:disabled view.isStep5Completed:completed isDeleteOnly:hidden"}}><a href="javascript:void(null);" {{action gotoStep5 target="controller"}}><i class="step-marker"><span class="step-index">5</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step5.header}}</p></a></li>
- <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled view.isStep6Completed:completed isDeleteOnly:hidden"}}><a href="javascript:void(null);" {{action gotoStep6 target="controller"}}><i class="step-marker"><span class="step-index">6</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step6.header}}</p></a></li>
- <li {{bindAttr class="isStep7:active view.isStep7Disabled:disabled view.isStep7Completed:completed isDeleteOnly:hidden"}}><a href="javascript:void(null);" {{action gotoStep5 target="controller"}}><i class="step-marker"><span class="step-index">7</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step7.header}}</p></a></li>
- <li {{bindAttr class="isStep8:active view.isStep8Disabled:disabled view.isStep8Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep6 target="controller"}}><i class="step-marker"><span class="step-index">{{#if isDeleteOnly}}4{{else}}8{{/if}}</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step8.header}}</p></a></li>
+ <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled view.isStep6Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep6 target="controller"}}><i class="step-marker"><span class="step-index">{{#if isDeleteOnly}}4{{else}}6{{/if}}</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step6.header}}</p></a></li>
+ <li {{bindAttr class="isStep7:active view.isStep7Disabled:disabled view.isStep7Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep7 target="controller"}}><i class="step-marker"><span class="step-index">{{#if isDeleteOnly}}5{{else}}7{{/if}}</span></i><p class="step-name">{{t admin.manageJournalNode.wizard.step7.header}}</p></a></li>
</ul>
</div>
{{outlet}}
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 59094d3..44301c4 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -194,7 +194,6 @@ require('views/main/admin/highAvailability/journalNode/step4_view');
require('views/main/admin/highAvailability/journalNode/step5_view');
require('views/main/admin/highAvailability/journalNode/step6_view');
require('views/main/admin/highAvailability/journalNode/step7_view');
-require('views/main/admin/highAvailability/journalNode/step8_view');
require('views/main/admin/highAvailability/resourceManager/wizard_view');
require('views/main/admin/highAvailability/resourceManager/step1_view');
require('views/main/admin/highAvailability/resourceManager/step2_view');
diff --git a/ambari-web/app/views/main/admin/highAvailability/journalNode/step5_view.js b/ambari-web/app/views/main/admin/highAvailability/journalNode/step5_view.js
index f371275..5ca84f3 100644
--- a/ambari-web/app/views/main/admin/highAvailability/journalNode/step5_view.js
+++ b/ambari-web/app/views/main/admin/highAvailability/journalNode/step5_view.js
@@ -16,32 +16,23 @@
* limitations under the License.
*/
-
var App = require('app');
App.ManageJournalNodeWizardStep5View = Em.View.extend({
templateName: require('templates/main/admin/highAvailability/journalNode/step5'),
- didInsertElement: function() {
- this.get('controller').loadStep();
- },
-
step5BodyText: function () {
- var activeNN = this.get('controller.content.activeNN');
- return Em.I18n.t('admin.manageJournalNode.wizard.step5.body').format(this.get('controller.content.hdfsUser'), activeNN.host_name);
- }.property('controller.content.masterComponentHosts'),
-
- jnCheckPointText: function () {
- switch (this.get('controller.status')) {
- case 'waiting':
- return Em.I18n.t('admin.highAvailability.wizard.step6.jsNoInit');
- case 'done':
- return Em.I18n.t('admin.highAvailability.wizard.step6.jsInit');
- case 'journalnode_stopped':
- return Em.I18n.t('admin.highAvailability.wizard.step6.jnStopped');
- default:
- return Em.I18n.t('admin.highAvailability.wizard.step6.jsNoInit');
- }
- }.property('controller.status')
+ const existingJournalNode = this.get('controller.content.masterComponentHosts').find(hc => {
+ return hc.component === 'JOURNALNODE' && hc.isInstalled;
+ }),
+ nameSpaces = App.HDFSService.find('HDFS').get('masterComponentGroups').mapProperty('name'),
+ hdfsSiteConfigs = this.get('controller.content.serviceConfigProperties.items').findProperty('type', 'hdfs-site'),
+ configProperties = hdfsSiteConfigs ? hdfsSiteConfigs.properties : {},
+ directories = nameSpaces.length > 1
+ ? nameSpaces.map(ns => configProperties[`dfs.journalnode.edits.dir.${ns}`]).uniq()
+ : [configProperties['dfs.journalnode.edits.dir']],
+ directoriesString = directories.map(dir => `<b>${dir}</b>`).join(', ');
+ return Em.I18n.t('admin.manageJournalNode.wizard.step5.body').format(existingJournalNode.hostName, directoriesString);
+ }.property('controller.content.masterComponentHosts', 'controller.isHDFSNameSpacesLoaded')
});
diff --git a/ambari-web/app/views/main/admin/highAvailability/journalNode/step7_view.js b/ambari-web/app/views/main/admin/highAvailability/journalNode/step7_view.js
index 1515bb3..f074bd2 100644
--- a/ambari-web/app/views/main/admin/highAvailability/journalNode/step7_view.js
+++ b/ambari-web/app/views/main/admin/highAvailability/journalNode/step7_view.js
@@ -16,16 +16,13 @@
* limitations under the License.
*/
-
var App = require('app');
-App.ManageJournalNodeWizardStep7View = Em.View.extend({
+App.ManageJournalNodeWizardStep7View = App.ManageJournalNodeProgressPageView.extend({
templateName: require('templates/main/admin/highAvailability/journalNode/step7'),
- step7BodyText: function () {
- var standByNN = this.get('controller.content.standByNN');
- return Em.I18n.t('admin.manageJournalNode.wizard.step7.body').format(this.get('controller.content.hdfsUser'), standByNN.host_name);
- }.property('controller.content.masterComponentHosts')
+ submitButtonText: Em.I18n.t('common.done'),
+ noticeCompleted: Em.I18n.t('admin.manageJournalNode.wizard.step7.notice.completed')
});
diff --git a/ambari-web/app/views/main/admin/highAvailability/journalNode/step8_view.js b/ambari-web/app/views/main/admin/highAvailability/journalNode/step8_view.js
deleted file mode 100644
index b2f8867..0000000
--- a/ambari-web/app/views/main/admin/highAvailability/journalNode/step8_view.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-var App = require('app');
-
-App.ManageJournalNodeWizardStep8View = App.ManageJournalNodeProgressPageView.extend({
-
- templateName: require('templates/main/admin/highAvailability/journalNode/step8'),
-
- submitButtonText: Em.I18n.t('common.done'),
-
- noticeCompleted: Em.I18n.t('admin.manageJournalNode.wizard.step8.notice.completed')
-});
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step4_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step4_controller_test.js
index 0c0ef5c..f534a40 100644
--- a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step4_controller_test.js
@@ -117,28 +117,6 @@ describe('App.ManageJournalNodeWizardStep4Controller', function () {
});
});
- describe('#startJournalNodes', function() {
-
- beforeEach(function() {
- sinon.stub(controller, 'updateComponent');
- });
-
- afterEach(function() {
- controller.updateComponent.restore();
- });
-
- it('updateComponent should be called', function() {
- controller.set('content.masterComponentHosts', [
- {
- component: 'JOURNALNODE',
- hostName: 'host1'
- }
- ]);
- controller.startJournalNodes();
- expect(controller.updateComponent.calledWith('JOURNALNODE', ['host1'], "HDFS", "Start")).to.be.true;
- });
- });
-
describe('#reconfigureHDFS', function() {
beforeEach(function() {
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step6_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step6_controller_test.js
index 8351628..9923600 100644
--- a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step6_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step6_controller_test.js
@@ -16,59 +16,44 @@
* limitations under the License.
*/
-
var App = require('app');
-require('controllers/main/admin/highAvailability/journalNode/step1_controller');
+require('controllers/main/admin/highAvailability/journalNode/step6_controller');
-describe('App.ManageJournalNodeWizardStep6Controller', function () {
+describe('App.ManageJournalNodeWizardStep7Controller', function () {
var controller;
beforeEach(function () {
- controller = App.ManageJournalNodeWizardStep6Controller.create({
- content: Em.Object.create()
- });
+ controller = App.ManageJournalNodeWizardStep6Controller.create();
});
- describe('#startZooKeeperServers', function() {
+ describe('#startJournalNodes', function () {
- beforeEach(function() {
+ beforeEach(function () {
sinon.stub(controller, 'updateComponent');
- });
-
- afterEach(function() {
- controller.updateComponent.restore();
- });
-
- it('updateComponent should be called', function() {
- controller.set('content.masterComponentHosts', [
+ sinon.stub(App.HostComponent, 'find').returns([
+ {
+ componentName: 'JOURNALNODE',
+ hostName: 'h0'
+ },
{
- component: 'ZOOKEEPER_SERVER',
- hostName: 'host1'
+ componentName: 'JOURNALNODE',
+ hostName: 'h1'
}
]);
- controller.startZooKeeperServers();
- expect(controller.updateComponent.calledWith('ZOOKEEPER_SERVER', ['host1'], "ZOOKEEPER", "Start")).to.be.true;
+ controller.startJournalNodes();
});
- });
-
- describe('#startActiveNameNode', function() {
- beforeEach(function() {
- sinon.stub(controller, 'updateComponent');
+ afterEach(function () {
+ controller.updateComponent.restore();
+ App.HostComponent.find.restore();
});
- afterEach(function() {
- controller.updateComponent.restore();
+ it('updateComponent should be called', function () {
+ expect(controller.updateComponent.calledOnce).to.be.true;
});
- it('updateComponent should be called', function() {
- controller.set('content.activeNN', {
- host_name: 'host1'
- });
- controller.startActiveNameNode();
- expect(controller.updateComponent.calledWith('NAMENODE', 'host1', "HDFS", "Start")).to.be.true;
+ it('updateComponent should be called with correct arguments', function () {
+ expect(controller.updateComponent.firstCall.args).to.eql(['JOURNALNODE', ['h0', 'h1'], 'HDFS', 'Start']);
});
});
-
});
-
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step7_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step7_controller_test.js
index 386d64e..ad1f1c6 100644
--- a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step7_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step7_controller_test.js
@@ -16,11 +16,9 @@
* limitations under the License.
*/
-
var App = require('app');
require('controllers/main/admin/highAvailability/journalNode/step7_controller');
-
describe('App.ManageJournalNodeWizardStep7Controller', function () {
var controller;
@@ -28,19 +26,19 @@ describe('App.ManageJournalNodeWizardStep7Controller', function () {
controller = App.ManageJournalNodeWizardStep7Controller.create();
});
- describe('#done', function() {
+ describe('#startAllServices', function() {
beforeEach(function() {
- sinon.stub(App.router, 'send');
+ sinon.stub(controller, 'startServices');
});
afterEach(function() {
- App.router.send.restore();
+ controller.startServices.restore();
});
- it('App.router.send should be called', function() {
- controller.done();
- expect(App.router.send.calledWith('next')).to.be.true;
+ it('startServices should be called', function() {
+ controller.startAllServices();
+ expect(controller.startServices.calledWith(false)).to.be.true;
});
});
});
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step8_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step8_controller_test.js
deleted file mode 100644
index 9642d4a..0000000
--- a/ambari-web/test/controllers/main/admin/highAvailability/journalNode/step8_controller_test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-var App = require('app');
-require('controllers/main/admin/highAvailability/journalNode/step8_controller');
-
-describe('App.ManageJournalNodeWizardStep8Controller', function () {
- var controller;
-
- beforeEach(function () {
- controller = App.ManageJournalNodeWizardStep8Controller.create();
- });
-
- describe('#stopHDFS', function() {
-
- beforeEach(function() {
- sinon.stub(controller, 'stopServices');
- });
-
- afterEach(function() {
- controller.stopServices.restore();
- });
-
- it('stopServices should be called', function() {
- controller.stopHDFS();
- expect(controller.stopServices.calledWith(['HDFS'], true)).to.be.true;
- });
- });
-
- describe('#startAllServices', function() {
-
- beforeEach(function() {
- sinon.stub(controller, 'startServices');
- });
-
- afterEach(function() {
- controller.startServices.restore();
- });
-
- it('stopServices should be called', function() {
- controller.startAllServices();
- expect(controller.startServices.calledWith(false)).to.be.true;
- });
- });
-});
--
To stop receiving notification emails like this one, please contact
ababiichuk@apache.org.