You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by od...@apache.org on 2015/12/24 21:46:38 UTC

ambari git commit: AMBARI-14208. hawq_dfs_url should use nameservice when hawq is installed on a HDFS HA cluster (bhuvnesh chaudhary via odiachenko).

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 246dc6800 -> 38f80a21f


AMBARI-14208. hawq_dfs_url should use nameservice when hawq is installed on a HDFS HA cluster (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/38f80a21
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/38f80a21
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/38f80a21

Branch: refs/heads/branch-2.2
Commit: 38f80a21fb8d06bd6e8c066de619045e6c4e9d75
Parents: 246dc68
Author: Oleksandr Diachenko <od...@pivotal.io>
Authored: Thu Dec 24 12:46:31 2015 -0800
Committer: Oleksandr Diachenko <od...@pivotal.io>
Committed: Thu Dec 24 12:46:31 2015 -0800

----------------------------------------------------------------------
 .../app/controllers/wizard/step7_controller.js      | 16 +++++++++++++---
 ambari-web/test/controllers/wizard/step7_test.js    |  6 ++++++
 2 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/38f80a21/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index bea3dd4..ffb44bc 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -965,12 +965,22 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
       {
         serviceName: 'ACCUMULO',
         configToUpdate: 'instance.volumes'
+      },
+      {
+        serviceName: 'HAWQ',
+        configToUpdate: 'hawq_dfs_url',
+        regexPattern: /(^.*:[0-9]+)(?=\/)/,
       }
     ]).forEach(function (c) {
       if (selectedServiceNames.contains(c.serviceName) && nameServiceId) {
-        var cfg = serviceConfigs.findProperty('serviceName', c.serviceName).configs.findProperty('name', c.configToUpdate),
-          newValue = cfg.get('value').replace(/\/\/.*:[0-9]+/i, '//' + nameServiceId.get('value'));
-
+        var cfg = serviceConfigs.findProperty('serviceName', c.serviceName).configs.findProperty('name', c.configToUpdate);
+        var regexPattern = /\/\/.*:[0-9]+/i;
+        var replacementValue = '//' + nameServiceId.get('value');
+        if (typeof(c.regexPattern) !== "undefined") {
+          regexPattern = c.regexPattern;
+          replacementValue = nameServiceId.get('value');
+        }
+        var newValue = cfg.get('value').replace(regexPattern, replacementValue);
         cfg.setProperties({
           value: newValue,
           recommendedValue: newValue

http://git-wip-us.apache.org/repos/asf/ambari/blob/38f80a21/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index 7d4cfd4..06b08a9 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -2012,6 +2012,12 @@ describe('App.InstallerStep7Controller', function () {
         configToUpdate: 'instance.volumes',
         oldValue: 'hdfs://localhost:8020/apps/accumulo/data',
         expectedNewValue: 'hdfs://' + dfsNameservices + '/apps/accumulo/data'
+      },
+      {
+        serviceName: 'HAWQ',
+        configToUpdate: 'hawq_dfs_url',
+        oldValue: 'localhost:8020/hawq_data',
+        expectedNewValue: dfsNameservices + '/hawq_data'
       }
     ]).forEach(function (test) {
       it(test.serviceName + ' ' + test.configToUpdate, function () {