ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject ambari git commit: AMBARI-11749 - Oozie Web Alert Has Wrong http Property In Alert Definition (jonathanhurley)
Date Sun, 07 Jun 2015 13:45:05 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ed5f01e00 -> 5459fefdb


AMBARI-11749 - Oozie Web Alert Has Wrong http Property In Alert Definition (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 5459fefdb2ac2368f683f2b864127e252707484b
Parents: ed5f01e
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Sat Jun 6 22:28:03 2015 -0400
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Sun Jun 7 09:44:58 2015 -0400

----------------------------------------------------------------------
 .../ambari/server/state/alert/AlertUri.java     | 11 +++++++
 .../server/upgrade/UpgradeCatalog210.java       | 30 ++++++++++++++++----
 .../common-services/OOZIE/4.0.0.2.0/alerts.json |  2 +-
 .../common-services/OOZIE/5.0.0.2.3/alerts.json |  2 +-
 .../BIGTOP/0.8/services/OOZIE/alerts.json       |  2 +-
 5 files changed, 38 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5459fefd/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
index c337dec..2a3d7c7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
@@ -100,6 +100,17 @@ public class AlertUri {
   }
 
   /**
+   * Sets the plaintext (HTTP) URI that can be used to retrieve alert
+   * information.
+   *
+   * @param httpUri
+   *          the plaintext URI or {@code null} for none.
+   */
+  public void setHttpUri(String httpUri) {
+    m_httpUri = httpUri;
+  }
+
+  /**
    * Gets the default port to use on the host running the alert if none of the
    * http properties are available.
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/5459fefd/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
index 76cd0fc..9e1404c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
@@ -58,6 +58,7 @@ import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.alert.AlertDefinition;
 import org.apache.ambari.server.state.alert.AlertDefinitionFactory;
 import org.apache.ambari.server.state.alert.PortSource;
+import org.apache.ambari.server.state.alert.WebSource;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.commons.lang.StringUtils;
@@ -1047,21 +1048,38 @@ public class UpgradeCatalog210 extends AbstractUpgradeCatalog {
 
           // zookeeper failover conroller alert update for default port and uri
           // to 8019 and dfs.ha.zkfc.port
-          AlertDefinitionEntity alertDefinitionEntity = alertDefinitionDAO.findByName(
+          AlertDefinitionEntity zkFailoverDefinitionEntity = alertDefinitionDAO.findByName(
               cluster.getClusterId(), "hdfs_zookeeper_failover_controller_process");
 
-          if (alertDefinitionEntity != null) {
-            AlertDefinition zkfcAlertDefinition = alertDefinitionFactory.coerce(alertDefinitionEntity);
+          if (zkFailoverDefinitionEntity != null) {
+            AlertDefinition zkfcAlertDefinition = alertDefinitionFactory.coerce(zkFailoverDefinitionEntity);
             PortSource portSource = (PortSource) zkfcAlertDefinition.getSource();
             portSource.setPort(8019);
             portSource.setUri("{{hdfs-site/dfs.ha.zkfc.port}}");
 
             // merge the definition back into the entity
-            alertDefinitionEntity = alertDefinitionFactory.merge(zkfcAlertDefinition,
-                alertDefinitionEntity);
+            zkFailoverDefinitionEntity = alertDefinitionFactory.merge(zkfcAlertDefinition,
+                zkFailoverDefinitionEntity);
 
             // save the changes
-            alertDefinitionDAO.merge(alertDefinitionEntity);
+            alertDefinitionDAO.merge(zkFailoverDefinitionEntity);
+          }
+
+          // oozie web url changed
+          AlertDefinitionEntity oozieWebDefinitionEntity = alertDefinitionDAO.findByName(
+              cluster.getClusterId(), "oozie_server_webui");
+
+          if (oozieWebDefinitionEntity != null) {
+            AlertDefinition oozieAlertDefinition = alertDefinitionFactory.coerce(oozieWebDefinitionEntity);
+            WebSource webSource = (WebSource) oozieAlertDefinition.getSource();
+            webSource.getUri().setHttpUri("{{oozie-site/oozie.base.url}}/?user.name={{oozie-env/oozie_user}}");
+
+            // merge the definition back into the entity
+            oozieWebDefinitionEntity = alertDefinitionFactory.merge(oozieAlertDefinition,
+                oozieWebDefinitionEntity);
+
+            // save the changes
+            alertDefinitionDAO.merge(oozieWebDefinitionEntity);
           }
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/5459fefd/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
index a14f782..e02a66a 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
@@ -11,7 +11,7 @@
         "source": {
           "type": "WEB",
           "uri": {
-            "http": "{{oozie-site/oozie.base.url}}/oozie/?user.name=oozie",
+            "http": "{{oozie-site/oozie.base.url}}/?user.name={{oozie-env/oozie_user}}",
             "kerberos_keytab": "{{oozie-site/oozie.authentication.kerberos.keytab}}",
             "kerberos_principal": "{{oozie-site/oozie.authentication.kerberos.principal}}",
             "connection_timeout": 5.0

http://git-wip-us.apache.org/repos/asf/ambari/blob/5459fefd/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
b/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
index d75d1b2..ceb923c 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
+++ b/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
@@ -11,7 +11,7 @@
         "source": {
           "type": "WEB",
           "uri": {
-            "http": "{{oozie-site/oozie.base.url}}/oozie/?user.name=oozie",
+            "http": "{{oozie-site/oozie.base.url}}/?user.name={{oozie-env/oozie_user}}",
             "kerberos_keytab": "{{oozie-site/oozie.authentication.kerberos.keytab}}",
             "kerberos_principal": "{{oozie-site/oozie.authentication.kerberos.principal}}",
             "connection_timeout": 5.0

http://git-wip-us.apache.org/repos/asf/ambari/blob/5459fefd/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
index e57a4f8..b9552b6 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
@@ -11,7 +11,7 @@
         "source": {
           "type": "WEB",
           "uri": {
-            "http": "{{oozie-site/oozie.base.url}}/oozie",
+            "http": "{{oozie-site/oozie.base.url}}",
             "connection_timeout": 5.0
           },
           "reporting": {


Mime
View raw message