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 3af5a07  AMBARI-22964. Add NameNode Federation wizard (akovalenko)
3af5a07 is described below

commit 3af5a0712e957b3a639666380719f51fa4d4b815
Author: Aleksandr Kovalenko <akovale...@apache.org>
AuthorDate: Mon Feb 12 13:07:27 2018 +0200

    AMBARI-22964. Add NameNode Federation wizard (akovalenko)
---
 ambari-web/app/controllers.js                      |   5 +
 .../main/admin/federation/step1_controller.js      |  24 +++
 .../main/admin/federation/step2_controller.js      |  25 ++++
 .../main/admin/federation/step3_controller.js      |  23 +++
 .../main/admin/federation/step4_controller.js      |  24 +++
 .../main/admin/federation/wizard_controller.js     | 150 +++++++++++++++++++
 .../main/admin/highAvailability_controller.js      |   9 ++
 ambari-web/app/controllers/main/service/item.js    |   5 +
 ambari-web/app/messages.js                         |   7 +
 ambari-web/app/models/host_component.js            |   6 +
 ambari-web/app/models/service.js                   |   2 +-
 ambari-web/app/routes/main.js                      |   2 +
 .../app/routes/namenode_federation_routes.js       | 163 +++++++++++++++++++++
 .../app/templates/main/admin/federation/step1.hbs  |  22 +++
 .../app/templates/main/admin/federation/step3.hbs  |  23 +++
 .../app/templates/main/admin/federation/step4.hbs  |  22 +++
 .../app/templates/main/admin/federation/wizard.hbs |  35 +++++
 ambari-web/app/utils/db.js                         |   1 +
 ambari-web/app/views.js                            |   5 +
 .../app/views/main/admin/federation/step1_view.js  |  25 ++++
 .../app/views/main/admin/federation/step2_view.js  |  23 +++
 .../app/views/main/admin/federation/step3_view.js  |  24 +++
 .../app/views/main/admin/federation/step4_view.js  |  24 +++
 .../app/views/main/admin/federation/wizard_view.js |  32 ++++
 ambari-web/app/views/main/service/item.js          |   7 +
 ambari-web/test/models/service_test.js             |   2 +-
 26 files changed, 688 insertions(+), 2 deletions(-)

diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index f7d77be..c68d306 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -56,6 +56,11 @@ 
require('controllers/main/admin/highAvailability/resourceManager/step1_controlle
 
require('controllers/main/admin/highAvailability/resourceManager/step2_controller');
 
require('controllers/main/admin/highAvailability/resourceManager/step3_controller');
 
require('controllers/main/admin/highAvailability/resourceManager/step4_controller');
+require('controllers/main/admin/federation/wizard_controller');
+require('controllers/main/admin/federation/step1_controller');
+require('controllers/main/admin/federation/step2_controller');
+require('controllers/main/admin/federation/step3_controller');
+require('controllers/main/admin/federation/step4_controller');
 
require('controllers/main/admin/highAvailability/hawq/addStandby/wizard_controller');
 
require('controllers/main/admin/highAvailability/hawq/addStandby/step1_controller');
 
require('controllers/main/admin/highAvailability/hawq/addStandby/step2_controller');
diff --git 
a/ambari-web/app/controllers/main/admin/federation/step1_controller.js 
b/ambari-web/app/controllers/main/admin/federation/step1_controller.js
new file mode 100644
index 0000000..af39d3c
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/step1_controller.js
@@ -0,0 +1,24 @@
+/**
+ * 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.NameNodeFederationWizardStep1Controller = Em.Controller.extend({
+  name: "nameNodeFederationWizardStep1Controller"
+});
+
diff --git 
a/ambari-web/app/controllers/main/admin/federation/step2_controller.js 
b/ambari-web/app/controllers/main/admin/federation/step2_controller.js
new file mode 100644
index 0000000..1312b95
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/step2_controller.js
@@ -0,0 +1,25 @@
+/**
+ * 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.NameNodeFederationWizardStep2Controller = 
Em.Controller.extend(App.AssignMasterComponents, {
+
+  name: "nameNodeFederationWizardStep2Controller"
+});
+
diff --git 
a/ambari-web/app/controllers/main/admin/federation/step3_controller.js 
b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
new file mode 100644
index 0000000..4b847f3
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/step3_controller.js
@@ -0,0 +1,23 @@
+/**
+ * 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.NameNodeFederationWizardStep3Controller = 
Em.Controller.extend(App.BlueprintMixin, {
+  name: "nameNodeFederationWizardStep3Controller"
+});
diff --git 
a/ambari-web/app/controllers/main/admin/federation/step4_controller.js 
b/ambari-web/app/controllers/main/admin/federation/step4_controller.js
new file mode 100644
index 0000000..2a293a3
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/step4_controller.js
@@ -0,0 +1,24 @@
+/**
+ * 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.NameNodeFederationWizardStep4Controller = 
App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
+
+  name: "nameNodeFederationWizardStep4Controller"
+});
diff --git 
a/ambari-web/app/controllers/main/admin/federation/wizard_controller.js 
b/ambari-web/app/controllers/main/admin/federation/wizard_controller.js
new file mode 100644
index 0000000..9e8347f
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/wizard_controller.js
@@ -0,0 +1,150 @@
+/**
+ * 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.NameNodeFederationWizardController = App.WizardController.extend({
+
+  name: 'nameNodeFederationWizardController',
+
+  totalSteps: 4,
+
+  /**
+   * @type {string}
+   */
+  displayName: Em.I18n.t('admin.nameNodeFederation.wizard.header'),
+
+  isFinished: false,
+
+  content: Em.Object.create({
+    controllerName: 'nameNodeFederationWizardController'
+  }),
+
+  /**
+   * Load data for all steps until <code>current step</code>
+   */
+  loadMap: {
+    '1': [
+      {
+        type: 'sync',
+        callback: function () {
+          this.load('cluster');
+        }
+      }
+    ],
+    '2': [
+      {
+        type: 'async',
+        callback: function () {
+          var self = this,
+            dfd = $.Deferred();
+          this.loadSelectedHosts();
+          this.loadServicesFromServer();
+          this.loadMasterComponentHosts().done(function () {
+            self.loadConfirmedHosts();
+            dfd.resolve();
+          });
+          return dfd.promise();
+        }
+      }
+    ],
+    '4': [
+      {
+        type: 'sync',
+        callback: function () {
+          this.loadTasksStatuses();
+          this.loadTasksRequestIds();
+          this.loadRequestIds();
+          this.loadConfigs();
+        }
+      }
+    ]
+  },
+
+  init: function () {
+    this._super();
+    this.clearStep();
+  },
+
+  clearStep: function () {
+    this.set('isFinished', false);
+  },
+
+  setCurrentStep: function (currentStep, completed) {
+    this._super(currentStep, completed);
+    App.clusterStatus.setClusterStatus({
+      clusterName: this.get('content.cluster.name'),
+      wizardControllerName: 'nameNodeFederationWizardController',
+      localdb: App.db.data
+    });
+  },
+
+  /**
+   * Save hosts for users selected hosts to local db and 
<code>controller.content</code>
+   * @param selectedHosts
+   */
+  saveSelectedHosts: function (selectedHosts) {
+    this.set('content.selectedHosts', selectedHosts);
+    this.setDBProperty('selectedHosts', selectedHosts);
+  },
+
+  /**
+   * Load hosts for user selected components from local db to 
<code>controller.content</code>
+   */
+  loadSelectedHosts: function() {
+    var selectedHosts = this.getDBProperty('selectedHosts');
+    this.set('content.selectedHosts', selectedHosts);
+  },
+
+  /**
+   * Save configs to load and apply them on Configure Components step
+   * @param configs
+   */
+  saveConfigs: function (configs) {
+    this.set('content.configs', configs);
+    this.setDBProperty('configs', configs);
+  },
+
+  /**
+   * Load configs to apply them on Configure Components step
+   */
+  loadConfigs: function() {
+    var configs = this.getDBProperty('configs');
+    this.set('content.configs', configs);
+  },
+
+  /**
+   * Remove all loaded data.
+   * Created as copy for App.router.clearAllSteps
+   */
+  clearAllSteps: function () {
+    this.clearInstallOptions();
+    // clear temporary information stored during the install
+    this.set('content.cluster', this.getCluster());
+  },
+
+  /**
+   * Clear all temporary data
+   */
+  finish: function () {
+    this.resetDbNamespace();
+    App.router.get('updateController').updateAll();
+    this.set('isFinished', true);
+  }
+});
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability_controller.js 
b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 4899b43..2e4eeed 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -117,6 +117,15 @@ App.MainAdminHighAvailabilityController = 
App.WizardController.extend({
   },
 
   /**
+   * enable NameNode Federation
+   * @return {Boolean}
+   */
+  enableNameNodeFederation: function () {
+    App.router.transitionTo('main.services.enableNameNodeFederation');
+    return true;
+  },
+
+  /**
    * open Manage JournalNode Wizard if there are two started NameNodes with 
defined active/standby state
    * @returns {boolean}
    */
diff --git a/ambari-web/app/controllers/main/service/item.js 
b/ambari-web/app/controllers/main/service/item.js
index 88fcda4..5bd160f 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1107,6 +1107,11 @@ App.MainServiceItemController = 
Em.Controller.extend(App.SupportClientConfigsDow
     });
   },
 
+  openNameNodeFederationWizard: function () {
+    var highAvailabilityController = 
App.router.get('mainAdminHighAvailabilityController');
+    highAvailabilityController.enableNameNodeFederation();
+  },
+
   /**
    * This method is called when user event to download configs for "All 
Clients"
    * is made from service action menu
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index b940874..b71cfa3 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1648,6 +1648,13 @@ Em.I18n.translations = {
   'admin.ra_highAvailability.closePopup':'Enable Ranger Admin HA Wizard is in 
progress. You must allow the wizard to complete for Ambari to be in usable 
state. ' +
   'If you choose to quit, you must follow manual instructions to complete or 
revert enabling Ranger Admin HA as documented in the Ambari User Guide. Are you 
sure you want to exit the wizard?',
 
+  'admin.nameNodeFederation.button.enable':'Add New HDFS Namespace',
+  'admin.nameNodeFederation.wizard.header': 'Add New HDFS Namespace',
+  'admin.nameNodeFederation.wizard.step1.header': 'Get Started',
+  'admin.nameNodeFederation.wizard.step2.header': 'Select Hosts',
+  'admin.nameNodeFederation.wizard.step3.header': 'Review',
+  'admin.nameNodeFederation.wizard.step4.header': 'Configure Components',
+
   'admin.security.title':'Kerberos security has not been enabled',
   'admin.security.enabled': 'Kerberos security is enabled',
   'admin.security.disabled': 'Kerberos security is disabled',
diff --git a/ambari-web/app/models/host_component.js 
b/ambari-web/app/models/host_component.js
index 8157b75..c67dca4 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -495,6 +495,12 @@ App.HostComponentActionMap = {
         cssClass: 'glyphicon glyphicon-play-circle',
         isHidden: false,
         disabled: false
+      },
+      TOGGLE_NN_FEDERATION: {
+        action: 'openNameNodeFederationWizard',
+        label: Em.I18n.t('admin.nameNodeFederation.button.enable'),
+        cssClass: 'glyphicon glyphicon-arrow-up',
+        //todo: provide disabled flag
       }
     };
   }
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index 563add8..138ba70 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -96,7 +96,7 @@ App.Service = DS.Model.extend({
   serviceTypes: function() {
     var typeServiceMap = {
       GANGLIA: ['MONITORING'],
-      HDFS: ['HA_MODE'],
+      HDFS: ['HA_MODE', 'FEDERATION'],
       YARN: ['HA_MODE'],
       RANGER: ['HA_MODE'],
       HAWQ: ['HA_MODE']
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 194fb14..8021043 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -886,6 +886,8 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
 
     enableRAHighAvailability: require('routes/ra_high_availability_routes'),
 
+    enableNameNodeFederation: require('routes/namenode_federation_routes'),
+
     addHawqStandby: require('routes/add_hawq_standby_routes'),
 
     removeHawqStandby: require('routes/remove_hawq_standby_routes'),
diff --git a/ambari-web/app/routes/namenode_federation_routes.js 
b/ambari-web/app/routes/namenode_federation_routes.js
new file mode 100644
index 0000000..2535e4a
--- /dev/null
+++ b/ambari-web/app/routes/namenode_federation_routes.js
@@ -0,0 +1,163 @@
+/**
+ * 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');
+
+module.exports = App.WizardRoute.extend({
+  route: '/NameNode/federation',
+
+  breadcrumbs: {
+    label: Em.I18n.t('admin.nameNodeFederation.wizard.header')
+  },
+
+  enter: function (router, transition) {
+    var nameNodeFederationWizardController = 
router.get('nameNodeFederationWizardController');
+    nameNodeFederationWizardController.dataLoading().done(function () {
+      //Set HDFS as current service
+      App.router.set('mainServiceItemController.content', 
App.Service.find().findProperty('serviceName', 'HDFS'));
+      App.router.get('updateController').set('isWorking', false);
+      var popup = App.ModalPopup.show({
+        classNames: ['wizard-modal-wrapper'],
+        modalDialogClasses: ['modal-xlg'],
+        header: Em.I18n.t('admin.nameNodeFederation.wizard.header'),
+        bodyClass: App.RMHighAvailabilityWizardView.extend({
+          controller: nameNodeFederationWizardController
+        }),
+        primary: Em.I18n.t('form.cancel'),
+        showFooter: false,
+        secondary: null,
+
+        onClose: function () {
+          var nameNodeFederationWizardController = 
router.get('nameNodeFederationWizardController'),
+              currStep = nameNodeFederationWizardController.get('currentStep');
+          if (parseInt(currStep) === 4) {
+            App.showConfirmationPopup(function () {
+              
nameNodeFederationWizardController.resetOnClose(nameNodeFederationWizardController,
 'main.services.index');
+            }, Em.I18n.t('admin.rm_highAvailability.closePopup'));
+          } else {
+            
nameNodeFederationWizardController.resetOnClose(nameNodeFederationWizardController,
 'main.services.index');
+          }
+        },
+        didInsertElement: function () {
+          this._super();
+          this.fitHeight();
+        }
+      });
+      nameNodeFederationWizardController.set('popup', popup);
+      var currentClusterStatus = App.clusterStatus.get('value');
+      if (currentClusterStatus) {
+        switch (currentClusterStatus.clusterState) {
+          case 'NN_FEDERATION_DEPLOY' :
+            
nameNodeFederationWizardController.setCurrentStep(currentClusterStatus.localdb.NameNodeFederationWizard.currentStep);
+            break;
+          default:
+            var currStep = 
App.router.get('nameNodeFederationWizardController.currentStep');
+            nameNodeFederationWizardController.setCurrentStep(currStep);
+            break;
+        }
+      }
+      Em.run.next(function () {
+        
App.router.get('wizardWatcherController').setUser(nameNodeFederationWizardController.get('name'));
+        router.transitionTo('step' + 
nameNodeFederationWizardController.get('currentStep'));
+      });
+    });
+  },
+
+  step1: Em.Route.extend({
+    route: '/step1',
+    connectOutlets: function (router) {
+      var controller = router.get('nameNodeFederationWizardController');
+      controller.dataLoading().done(function () {
+        controller.setCurrentStep('1');
+        controller.connectOutlet('nameNodeFederationWizardStep1', 
controller.get('content'));
+      })
+    },
+    unroutePath: function () {
+      return false;
+    },
+    next: function (router) {
+      router.transitionTo('step2');
+    }
+  }),
+
+  step2: Em.Route.extend({
+    route: '/step2',
+    connectOutlets: function (router) {
+      var controller = router.get('nameNodeFederationWizardController');
+      controller.dataLoading().done(function () {
+        controller.setCurrentStep('2');
+        controller.loadAllPriorSteps();
+        controller.connectOutlet('nameNodeFederationWizardStep2', 
controller.get('content'));
+      })
+    },
+    unroutePath: function () {
+      return false;
+    },
+    next: function (router) {
+      router.transitionTo('step3');
+    },
+    back: function (router) {
+      router.transitionTo('step1');
+    }
+  }),
+
+  step3: Em.Route.extend({
+    route: '/step3',
+    connectOutlets: function (router) {
+      var controller = router.get('nameNodeFederationWizardController');
+      controller.dataLoading().done(function () {
+        controller.setCurrentStep('3');
+        controller.loadAllPriorSteps();
+        controller.connectOutlet('nameNodeFederationWizardStep3', 
controller.get('content'));
+      })
+    },
+    unroutePath: function () {
+      return false;
+    },
+    next: function (router) {
+      router.transitionTo('step4');
+    },
+    back: Em.Router.transitionTo('step2')
+  }),
+
+  step4: Em.Route.extend({
+    route: '/step4',
+    connectOutlets: function (router) {
+      var controller = router.get('nameNodeFederationWizardController');
+      controller.dataLoading().done(function () {
+        controller.setCurrentStep('4');
+        controller.setLowerStepsDisable(4);
+        controller.loadAllPriorSteps();
+        controller.connectOutlet('nameNodeFederationWizardStep4', 
controller.get('content'));
+      })
+    },
+    unroutePath: function (router, path) {
+      // allow user to leave route if wizard has finished
+      if (router.get('nameNodeFederationWizardController').get('isFinished')) {
+        this._super(router, path);
+      } else {
+        return false;
+      }
+    },
+    next: function (router) {
+      var controller = router.get('nameNodeFederationWizardController');
+      controller.resetOnClose(controller, 'main.services.index');
+    }
+  })
+
+});
diff --git a/ambari-web/app/templates/main/admin/federation/step1.hbs 
b/ambari-web/app/templates/main/admin/federation/step1.hbs
new file mode 100644
index 0000000..840d461
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/step1.hbs
@@ -0,0 +1,22 @@
+{{!
+* 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.
+}}
+<div class="wizard-footer col-md-12">
+  <div class="btn-area">
+    <button class="btn btn-success pull-right" {{action next}}>{{t 
common.next}} &rarr;</button>
+  </div>
+</div>
diff --git a/ambari-web/app/templates/main/admin/federation/step3.hbs 
b/ambari-web/app/templates/main/admin/federation/step3.hbs
new file mode 100644
index 0000000..e0e2ecf
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/step3.hbs
@@ -0,0 +1,23 @@
+{{!
+* 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.
+}}
+<div class="wizard-footer col-md-12">
+  <div class="btn-area">
+    <a class="btn btn-default" {{action back}}>&larr; {{t common.back}}</a>
+    <button class="btn btn-success pull-right" {{action next}}>{{t 
common.next}} &rarr;</button>
+  </div>
+</div>
diff --git a/ambari-web/app/templates/main/admin/federation/step4.hbs 
b/ambari-web/app/templates/main/admin/federation/step4.hbs
new file mode 100644
index 0000000..840d461
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/step4.hbs
@@ -0,0 +1,22 @@
+{{!
+* 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.
+}}
+<div class="wizard-footer col-md-12">
+  <div class="btn-area">
+    <button class="btn btn-success pull-right" {{action next}}>{{t 
common.next}} &rarr;</button>
+  </div>
+</div>
diff --git a/ambari-web/app/templates/main/admin/federation/wizard.hbs 
b/ambari-web/app/templates/main/admin/federation/wizard.hbs
new file mode 100644
index 0000000..32096e1
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/wizard.hbs
@@ -0,0 +1,35 @@
+{{!
+* 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.
+}}
+
+<div id="rm-ha-wizard" class="wizard">
+  <div class="wizard-body row">
+    <div class="wizard-nav col-md-3">
+      <ul class="nav nav-pills nav-stacked">
+        <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled 
view.isStep1Completed:completed"}}><a href="javascript:void(null);"  {{action 
gotoStep1 target="controller"}}><i class="step-marker"><span 
class="step-index">1</span></i><p class="step-name">{{t 
admin.nameNodeFederation.wizard.step1.header}}</p></a></li>
+        <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled 
view.isStep2Completed:completed"}}><a href="javascript:void(null);"  {{action 
gotoStep2 target="controller"}}><i class="step-marker"><span 
class="step-index">2</span></i><p class="step-name">{{t 
admin.nameNodeFederation.wizard.step2.header}}</p></a></li>
+        <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled 
view.isStep3Completed:completed"}}><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.nameNodeFederation.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">4</span></i><p class="step-name">{{t 
admin.nameNodeFederation.wizard.step4.header}}</p></a></li>
+      </ul>
+    </div>
+      {{#if view.isLoaded}}
+        {{outlet}}
+      {{else}}
+        {{view App.SpinnerView}}
+      {{/if}}
+  </div>
+</div>
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index 3e0b65a..f45ba24 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -47,6 +47,7 @@ var InitialData = {
   'RemoveHawqStandbyWizard': {},
   'ActivateHawqStandbyWizard': {},
   'RAHighAvailabilityWizard': {},
+  'NameNodeFederationWizard': {},
   'RollbackHighAvailabilityWizard': {},
   'MainAdminStackAndUpgrade': {},
   'KerberosDisable': {},
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index ec4675e..fa51bfa 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -220,6 +220,11 @@ 
require('views/main/admin/highAvailability/rangerAdmin/step1_view');
 require('views/main/admin/highAvailability/rangerAdmin/step2_view');
 require('views/main/admin/highAvailability/rangerAdmin/step3_view');
 require('views/main/admin/highAvailability/rangerAdmin/step4_view');
+require('views/main/admin/federation/wizard_view');
+require('views/main/admin/federation/step1_view');
+require('views/main/admin/federation/step2_view');
+require('views/main/admin/federation/step3_view');
+require('views/main/admin/federation/step4_view');
 require('views/main/admin/serviceAccounts_view');
 require('views/main/admin/stack_upgrade/upgrade_wizard_view');
 require('views/main/admin/stack_upgrade/upgrade_version_box_view');
diff --git a/ambari-web/app/views/main/admin/federation/step1_view.js 
b/ambari-web/app/views/main/admin/federation/step1_view.js
new file mode 100644
index 0000000..c44e43c
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/step1_view.js
@@ -0,0 +1,25 @@
+/**
+ * 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.NameNodeFederationWizardStep1View = Em.View.extend({
+
+  templateName: require('templates/main/admin/federation/step1')
+
+});
diff --git a/ambari-web/app/views/main/admin/federation/step2_view.js 
b/ambari-web/app/views/main/admin/federation/step2_view.js
new file mode 100644
index 0000000..af68025
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/step2_view.js
@@ -0,0 +1,23 @@
+/**
+ * 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.NameNodeFederationWizardStep2View = App.AssignMasterComponentsView.extend({
+});
diff --git a/ambari-web/app/views/main/admin/federation/step3_view.js 
b/ambari-web/app/views/main/admin/federation/step3_view.js
new file mode 100644
index 0000000..f7b9555
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/step3_view.js
@@ -0,0 +1,24 @@
+/**
+ * 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.NameNodeFederationWizardStep3View = Em.View.extend({
+
+  templateName: require('templates/main/admin/federation/step3')
+});
diff --git a/ambari-web/app/views/main/admin/federation/step4_view.js 
b/ambari-web/app/views/main/admin/federation/step4_view.js
new file mode 100644
index 0000000..d645beb
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/step4_view.js
@@ -0,0 +1,24 @@
+/**
+ * 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.NameNodeFederationWizardStep4View = 
App.HighAvailabilityProgressPageView.extend({
+
+  templateName: require('templates/main/admin/federation/step4')
+});
diff --git a/ambari-web/app/views/main/admin/federation/wizard_view.js 
b/ambari-web/app/views/main/admin/federation/wizard_view.js
new file mode 100644
index 0000000..4df098c
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/wizard_view.js
@@ -0,0 +1,32 @@
+/**
+ * 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.NameNodeFederationWizardView = Em.View.extend(App.WizardMenuMixin, 
App.WizardHostsLoading, {
+
+  templateName: require('templates/main/admin/federation/wizard'),
+
+  didInsertElement: function() {
+    var currentStep = this.get('controller.currentStep');
+    if (currentStep > 3) {
+      this.get('controller').setLowerStepsDisable(currentStep);
+    }
+  }
+});
diff --git a/ambari-web/app/views/main/service/item.js 
b/ambari-web/app/views/main/service/item.js
index 72e5e39..dc6f568 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -183,6 +183,13 @@ App.MainServiceItemView = Em.View.extend({
             break;
         }
       }
+      if (service.get('serviceTypes').contains('FEDERATION') && 
App.isAuthorized('SERVICE.ENABLE_HA')) {
+        switch (service.get('serviceName')) {
+          case 'HDFS':
+            options.push(actionMap.TOGGLE_NN_FEDERATION);
+            break;
+        }
+      }
       if (serviceCheckSupported) {
         options.push(actionMap.RUN_SMOKE_TEST);
       }
diff --git a/ambari-web/test/models/service_test.js 
b/ambari-web/test/models/service_test.js
index 887aa28..c600af6 100644
--- a/ambari-web/test/models/service_test.js
+++ b/ambari-web/test/models/service_test.js
@@ -137,7 +137,7 @@ describe('App.Service', function () {
       },
       {
         serviceName: 'HDFS',
-        result: ['HA_MODE']
+        result: ['HA_MODE', 'FEDERATION']
       },
       {
         serviceName: 'YARN',

-- 
To stop receiving notification emails like this one, please contact
akovale...@apache.org.

Reply via email to