Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 726860a64 -> 3d5b441a8


AMBARI-14225. NN HA wizard should update hawq_dfs_url with nameservice when ha 
is enabled by ambari(Bhuvnesh Chaudhary via odiachenko).


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3d5b441a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3d5b441a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3d5b441a

Branch: refs/heads/branch-2.2
Commit: 3d5b441a8d83016396e4c815df48ac657517f4c6
Parents: 726860a
Author: Oleksandr Diachenko <odiache...@pivotal.io>
Authored: Wed Dec 30 17:12:39 2015 -0800
Committer: Oleksandr Diachenko <odiache...@pivotal.io>
Committed: Wed Dec 30 17:12:39 2015 -0800

----------------------------------------------------------------------
 .../nameNode/rollback_controller.js             | 32 ++++++++++++++++++++
 .../nameNode/step3_controller.js                | 10 ++++++
 .../nameNode/step9_controller.js                | 21 ++++++++++++-
 ambari-web/app/data/HDP2/ha_properties.js       | 17 +++++++++--
 ambari-web/app/messages.js                      | 27 +++++++++--------
 5 files changed, 92 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3d5b441a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
index e86b52e..697e272 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
@@ -34,6 +34,7 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
     'stopAllServices',
     'restoreHBaseConfigs',
     'restoreAccumuloConfigs',
+    'restoreHawqConfigs',
     'stopFailoverControllers',
     'deleteFailoverControllers',
     'stopStandbyNameNode',
@@ -70,6 +71,7 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
       'startAllServices',
       'reconfigureHBase',
       'reconfigureAccumulo',
+      'reconfigureHawq',
       'startZKFC',
       'installZKFC',
       'startSecondNameNode',
@@ -101,6 +103,10 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
     if (!App.Service.find().someProperty('serviceName', 'ACCUMULO') && 
accumuloTask) {
       this.get('tasks').splice(accumuloTask.get('id'), 1);
     }
+    var hawqTask = this.get('tasks').findProperty('command', 
'restoreHawqConfigs');
+    if (!App.Service.find().someProperty('serviceName', 'HAWQ') && hawqTask) {
+      this.get('tasks').splice(hawqTask.get('id'), 1);
+    }
   },
 
   clearStep: function () {
@@ -254,6 +260,19 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
       error: 'onTaskError'
     });
   },
+  restoreHawqConfigs: function(){
+    this.loadConfigTag("hawqSiteTag");
+    var hawqSiteTag = this.get("content.hawqSiteTag");
+    App.ajax.send({
+      name: 'admin.high_availability.load_hawq_configs',
+      sender: this,
+      data: {
+        hawqSiteTag: hawqSiteTag
+      },
+      success: 'onLoadHawqConfigs',
+      error: 'onTaskError'
+    });
+  },
 
   stopFailoverControllers: function(){
     console.warn('func: stopFailoverControllers');
@@ -344,6 +363,19 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
     });
   },
 
+  onLoadHawqConfigs: function (data) {
+    var hawqSiteProperties = data.items.findProperty('type', 
'hawq-site').properties;
+    App.ajax.send({
+      name: 'admin.high_availability.save_configs',
+      sender: this,
+      data: {
+        siteName: 'hawq-site',
+        properties: hawqSiteProperties
+      },
+      success: 'onTaskCompleted',
+      error: 'onTaskError'
+    });
+  },
   onDeletedHDFSClient: function () {
     console.warn('func: onDeletedHDFSClient');
     var deletedHdfsClients = this.get('deletedHdfsClients');

http://git-wip-us.apache.org/repos/asf/ambari/blob/3d5b441a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
index 3cb7be7..699f606 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
@@ -84,6 +84,11 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
       urlParams.push('(type=ams-hbase-site&tag=' + amsHbaseSiteTag + ')');
       this.set("amsHbaseSiteTag", {name : "amsHbaseSiteTag", value : 
amsHbaseSiteTag});
     }
+    if (App.Service.find().someProperty('serviceName', 'HAWQ')) {
+      var hawqSiteTag = data.Clusters.desired_configs['hawq-site'].tag;
+      urlParams.push('(type=hawq-site&tag=' + hawqSiteTag + ')');
+      this.set("hawqSiteTag", {name : "hawqSiteTag", value : hawqSiteTag});
+    }
     App.ajax.send({
       name: 'admin.get.all_configurations',
       sender: this,
@@ -187,6 +192,11 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
      value = this.get('serverConfigData.items').findProperty('type', 
'hdfs-site').properties['dfs.journalnode.edits.dir'];
      this.setConfigInitialValue(config, value);
     }
+    if (App.Service.find().someProperty('serviceName', 'HAWQ')) {
+      config = configs.filterProperty('filename', 
'hawq-site').findProperty('name','hawq_dfs_url');
+      value = this.get('serverConfigData.items').findProperty('type', 
'hawq-site').properties['hawq_dfs_url'].replace(/(^.*:[0-9]+)(?=\/)/, 
nameServiceId);
+      this.setConfigInitialValue(config,value);
+    }
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/3d5b441a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
index 580977a..4b661ca 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
@@ -22,10 +22,11 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
 
   name:"highAvailabilityWizardStep9Controller",
 
-  commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 
'reconfigureHBase', 'reconfigureAccumulo', 'deleteSNameNode', 
'startAllServices'],
+  commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 
'reconfigureHBase', 'reconfigureAccumulo', 'reconfigureHawq', 
'deleteSNameNode', 'startAllServices'],
 
   hbaseSiteTag: "",
   accumuloSiteTag: "",
+  hawqSiteTag: "",
 
   initializeTasks: function () {
     this._super();
@@ -36,6 +37,10 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
     }
     if (!App.Service.find().someProperty('serviceName', 'ACCUMULO')) {
       this.get('tasks').splice(this.get('tasks').findProperty('command', 
'reconfigureAccumulo').get('id') - numSpliced, 1);
+      numSpliced++ ;
+    }
+    if (!App.Service.find().someProperty('serviceName', 'HAWQ')) {
+      this.get('tasks').splice(this.get('tasks').findProperty('command', 
'reconfigureHawq').get('id') - numSpliced, 1);
     }
   },
 
@@ -82,6 +87,20 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
     });
   },
 
+  reconfigureHawq: function () {
+    var data = this.get('content.serviceConfigProperties');
+    var configData = this.reconfigureSites(['hawq-site'], data, 
Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
+    App.ajax.send({
+      name: 'common.service.configurations',
+      sender: this,
+      data: {
+        desired_config: configData
+      },
+      success: 'saveConfigTag',
+      error: 'onTaskError'
+    });
+  },
+
   saveConfigTag: function () {
     App.clusterStatus.setClusterStatus({
       clusterName: this.get('content.cluster.name'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/3d5b441a/ambari-web/app/data/HDP2/ha_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/ha_properties.js 
b/ambari-web/app/data/HDP2/ha_properties.js
index 627018a..8b2960d 100644
--- a/ambari-web/app/data/HDP2/ha_properties.js
+++ b/ambari-web/app/data/HDP2/ha_properties.js
@@ -25,9 +25,10 @@ module.exports =
       App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'}),
       App.ServiceConfigCategory.create({ name: 'HBASE', displayName: 'HBase'}),
       App.ServiceConfigCategory.create({ name: 'ACCUMULO', displayName: 
'Accumulo'}),
-      App.ServiceConfigCategory.create({ name: 'AMBARI_METRICS', displayName: 
'Ambari Metrics'})
+      App.ServiceConfigCategory.create({ name: 'AMBARI_METRICS', displayName: 
'Ambari Metrics'}),
+      App.ServiceConfigCategory.create({ name: 'HAWQ', displayName: 'HAWQ'})
     ],
-    sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site', 
'ams-hbase-site'],
+    sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site', 
'ams-hbase-site', 'hawq-site'],
     configs: [
     
/**********************************************HDFS***************************************/
       {
@@ -250,6 +251,18 @@ module.exports =
         "isVisible": false,
         "filename": "ams-hbase-site",
         "serviceName": 'MISC'
+      },
+    
/**********************************************HAWQ***************************************/
+      {
+        "name": "hawq_dfs_url",
+        "displayName": "hawq_dfs_url",
+        "description": "URL for Accessing HDFS",
+        "isReconfigurable": false,
+        "recommendedValue": "haCluster/hawq_default",
+        "value": "haCluster/hawq_default",
+        "category": "HAWQ",
+        "filename": "hawq-site",
+        "serviceName": 'MISC'
       }
     ]
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3d5b441a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 905197a..72db077 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1199,8 +1199,9 @@ Em.I18n.translations = {
   'admin.highAvailability.wizard.step9.task2.title':'Start Failover 
Controllers',
   'admin.highAvailability.wizard.step9.task3.title':'Reconfigure HBase',
   'admin.highAvailability.wizard.step9.task4.title':'Reconfigure Accumulo',
-  'admin.highAvailability.wizard.step9.task5.title':'Delete Secondary 
NameNode',
-  'admin.highAvailability.wizard.step9.task6.title':'Start All Services',
+  'admin.highAvailability.wizard.step9.task5.title':'Reconfigure HAWQ',
+  'admin.highAvailability.wizard.step9.task6.title':'Delete Secondary 
NameNode',
+  'admin.highAvailability.wizard.step9.task7.title':'Start All Services',
   'admin.highAvailability.wizard.step9.notice.completed':'NameNode HA has been 
enabled successfully.',
 
   'admin.highAvailability.wizard.step3.curNameNode': '<b>Current NameNode:</b> 
',
@@ -1221,16 +1222,18 @@ Em.I18n.translations = {
   'admin.highAvailability.rollback.header':'Disable NameNode HA Wizard',
   'admin.highAvailability.rollback.task0.title':'Stop All Services',
   'admin.highAvailability.rollback.task1.title':'Restore HBase Configurations',
-  'admin.highAvailability.rollback.task2.title':'Stop Failover Controllers',
-  'admin.highAvailability.rollback.task3.title':'Delete Failover Controllers',
-  'admin.highAvailability.rollback.task4.title':'Stop Additional NameNode',
-  'admin.highAvailability.rollback.task5.title':'Stop NameNode',
-  'admin.highAvailability.rollback.task6.title':'Restore HDFS Configurations',
-  'admin.highAvailability.rollback.task7.title':'Enable Secondary NameNode',
-  'admin.highAvailability.rollback.task8.title':'Stop JournalNodes',
-  'admin.highAvailability.rollback.task9.title':'Delete JournalNodes',
-  'admin.highAvailability.rollback.task10.title':'Delete Additional NameNode',
-  'admin.highAvailability.rollback.task11.title':'Start All Services',
+  'admin.highAvailability.rollback.task2.title':'Restore Accumulo 
Configurations',
+  'admin.highAvailability.rollback.task3.title':'Restore HAWQ Configurations',
+  'admin.highAvailability.rollback.task4.title':'Stop Failover Controllers',
+  'admin.highAvailability.rollback.task5.title':'Delete Failover Controllers',
+  'admin.highAvailability.rollback.task6.title':'Stop Additional NameNode',
+  'admin.highAvailability.rollback.task7.title':'Stop NameNode',
+  'admin.highAvailability.rollback.task8.title':'Restore HDFS Configurations',
+  'admin.highAvailability.rollback.task9.title':'Enable Secondary NameNode',
+  'admin.highAvailability.rollback.task10.title':'Stop JournalNodes',
+  'admin.highAvailability.rollback.task11.title':'Delete JournalNodes',
+  'admin.highAvailability.rollback.task12.title':'Delete Additional NameNode',
+  'admin.highAvailability.rollback.task13.title':'Start All Services',
   'admin.highAvailability.rollback.notice.inProgress':'Please wait while the 
wizard reverts back to the non-HA setup.',
 
   'admin.highAvailability.rollback.step2.body':

Reply via email to