This is an automated email from the ASF dual-hosted git repository.
ishanbha 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 7e39765 [AMBARI-24857] UI Changes for supporting Ozone deployment.
(#2570)
7e39765 is described below
commit 7e39765aec2df9030d3a970f58b0d53c6c2d0254
Author: Ishan Bhatt <[email protected]>
AuthorDate: Mon Nov 5 07:56:43 2018 -0800
[AMBARI-24857] UI Changes for supporting Ozone deployment. (#2570)
* [AMBARI-24857] UI Changes for supporting Ozone deployment.
* minor code fix
* Minor code fix
* Minor code fix
* Minor code fix
---
.../app/controllers/wizard/step4_controller.js | 41 +++++++++++++++++-----
.../app/controllers/wizard/step6_controller.js | 5 ++-
ambari-web/app/models/stack_service.js | 17 ++++++++-
ambari-web/app/views/main/host/summary.js | 3 ++
4 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js
b/ambari-web/app/controllers/wizard/step4_controller.js
index 767147d..e2fc90b 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -59,11 +59,27 @@ App.WizardStep4Controller = Em.ArrayController.extend({
*/
errorStack: [],
+ isAddServiceWizard: Em.computed.equal('content.controllerName',
'addServiceController'),
+
+ isOzoneInstalled: function() {
+ let isOzone = this.findProperty('serviceName', 'OZONE');
+ return isOzone && isOzone.get('isInstalled');
+ }.property('@each.isInstalled'),
+
/**
* Services which are HDFS compatible
*/
fileSystems: function() {
- var fileSystems = this.filterProperty('isDFS', true);;
+ let fileSystems = [];
+ const self = this;
+ this.filterProperty('isDFS', true).forEach((fs) => {
+ if (self.get('isAddServiceWizard') && self.get('isOzoneInstalled') &&
+ fs.get('serviceName') === 'HDFS') {
+ return;
+ }
+ fileSystems.push(fs);
+ });
+
return fileSystems.map(function(fs) {
return App.FileSystem.create({content: fs, services: fileSystems});
});
@@ -318,7 +334,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({
*/
isDFSStack: function () {
var bDFSStack = false;
- var dfsServices = ['HDFS', 'GLUSTERFS'];
+ var dfsServices = ['HDFS', 'GLUSTERFS', 'OZONE'];
var availableServices = this.filterProperty('isInstalled',false);
availableServices.forEach(function(service){
if (dfsServices.contains(service.get('serviceName')) ||
service.get('serviceType') == 'HCFS' ) {
@@ -335,12 +351,26 @@ App.WizardStep4Controller = Em.ArrayController.extend({
*/
fileSystemServiceValidation: function(callback) {
if(this.isDFSStack()){
+ const self = this;
var primaryDFS = this.findProperty('isPrimaryDFS',true);
if (primaryDFS) {
var primaryDfsDisplayName =
primaryDFS.get('displayNameOnSelectServicePage');
var primaryDfsServiceName = primaryDFS.get('serviceName');
+ //if multiple DFS are not selected, remove the related error from the
error array
+ let removeFsError = function () {
+ let fsError =
self.get('errorStack').findProperty('id',"multipleDFS");
+ if(fsError)
+ {
+ self.get('errorStack').removeObject(fsError);
+ }
+ };
if (this.multipleDFSs()) {
var dfsServices =
this.filterProperty('isDFS',true).filterProperty('isSelected',true).mapProperty('serviceName');
+ //special case for HDFS and OZONE
+ if (dfsServices.length === 2 && dfsServices.includes('HDFS') &&
dfsServices.includes('OZONE')) {
+ removeFsError();
+ return;
+ }
var services = dfsServices.map(function (item){
return {
serviceName: item,
@@ -355,12 +385,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({
}
else
{
- //if multiple DFS are not selected, remove the related error from
the error array
- var fsError =
this.get('errorStack').filterProperty('id',"multipleDFS");
- if(fsError)
- {
- this.get('errorStack').removeObject(fsError[0]);
- }
+ removeFsError();
}
}
}
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js
b/ambari-web/app/controllers/wizard/step6_controller.js
index eb3e2cf..5952ed7 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -302,9 +302,11 @@ App.WizardStep6Controller =
Em.Controller.extend(App.HostComponentValidationMixi
else if (this.get('isAddServiceWizard')) services =
installedServices.concat(selectedServices);
var headers = Em.A([]);
+ let doHideOzoneDataNodes = !!services.findProperty('serviceName', 'HDFS');
services.forEach(function (stackService) {
stackService.get('serviceComponents').forEach(function
(serviceComponent) {
- if (serviceComponent.get('isShownOnInstallerSlaveClientPage')) {
+ let hideComponent = serviceComponent.get('componentName') ===
'OZONE_DATANODE' ? doHideOzoneDataNodes : false;
+ if (serviceComponent.get('isShownOnInstallerSlaveClientPage') &&
!hideComponent) {
headers.pushObject(Em.Object.create({
name: serviceComponent.get('componentName'),
label: App.format.role(serviceComponent.get('componentName'),
false),
@@ -339,6 +341,7 @@ App.WizardStep6Controller =
Em.Controller.extend(App.HostComponentValidationMixi
}
},
+
/**
* Returns list of new hosts
*
diff --git a/ambari-web/app/models/stack_service.js
b/ambari-web/app/models/stack_service.js
index 618f716..b911360 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -75,9 +75,24 @@ App.FileSystem = Ember.ObjectProxy.extend({
content: null,
services: [],
+ //special case for HDFS and OZONE. They can be selected together
+ shouldAllSelectionBeCleared: function () {
+ const dfsNames = this.get('services').mapProperty('serviceName');
+ const coExistingDfs = ['HDFS', 'OZONE'],
+ selectedServices = this.get('services').filterProperty('isSelected');
+ for (let i = 0; i < selectedServices.length; i++) {
+ if (!coExistingDfs.includes(selectedServices[i].get('serviceName'))) {
+ return true;
+ }
+ }
+ return !(dfsNames.includes('HDFS') && dfsNames.includes('OZONE') &&
coExistingDfs.includes(this.get('content.serviceName')));
+ },
+
isSelected: function(key, aBoolean) {
if (arguments.length > 1) {
- this.clearAllSelection();
+ if (this.shouldAllSelectionBeCleared()) {
+ this.clearAllSelection();
+ }
this.get('content').set('isSelected', aBoolean);
}
return this.get('content.isSelected');
diff --git a/ambari-web/app/views/main/host/summary.js
b/ambari-web/app/views/main/host/summary.js
index 43585d7..6397365 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -229,6 +229,9 @@ App.MainHostSummaryView =
Em.View.extend(App.HiveInteractiveCheck, App.TimeRange
addableComponent.get('componentName') ===
'HIVE_SERVER_INTERACTIVE' && !self.get('enableHiveInteractive')) {
return;
}
+ if (installedServices.includes('HDFS') &&
addableComponent.get('componentName') === 'OZONE_DATANODE') {
+ return;
+ }
components.pushObject(self.addableComponentObject.create({
'componentName': addableComponent.get('componentName'),
'serviceName': addableComponent.get('serviceName')