You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/05/24 12:49:28 UTC
[2/2] ambari git commit: AMBARI-16837. Storm REST API alert is
displayed and is always None (aonishuk)
AMBARI-16837. Storm REST API alert is displayed and is always None (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ceb663e7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ceb663e7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ceb663e7
Branch: refs/heads/branch-2.4
Commit: ceb663e7c745f4889c27a017976b1455eca4d374
Parents: 9633574
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue May 24 15:49:29 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue May 24 15:49:29 2016 +0300
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog240.java | 6 +++++
.../common-services/STORM/0.9.1/alerts.json | 27 --------------------
.../HDPWIN/2.1/services/STORM/alerts.json | 27 --------------------
.../server/upgrade/UpgradeCatalog240Test.java | 8 ++++++
4 files changed, 14 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ceb663e7/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
index 55aa055..1542356 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
@@ -805,6 +805,12 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
atlasMetadataServerWebUI.setSource(sourceJson.toString());
alertDefinitionDAO.merge(atlasMetadataServerWebUI);
}
+
+ AlertDefinitionEntity stormRestApiAlertDefinition = alertDefinitionDAO.findByName(clusterID, "storm_rest_api");
+ if (stormRestApiAlertDefinition != null) {
+ LOG.info("Removing alert : storm_rest_api");
+ alertDefinitionDAO.remove(stormRestApiAlertDefinition);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ceb663e7/ambari-server/src/main/resources/common-services/STORM/0.9.1/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1/alerts.json b/ambari-server/src/main/resources/common-services/STORM/0.9.1/alerts.json
index ae03617..842538d 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1/alerts.json
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1/alerts.json
@@ -136,33 +136,6 @@
}
}
],
- "STORM_REST_API": [
- {
- "name": "storm_rest_api",
- "label": "Storm REST API",
- "interval": 1,
- "scope": "ANY",
- "enabled": true,
- "source": {
- "type": "PORT",
- "uri": "8745",
- "default_port": 8745,
- "reporting": {
- "ok": {
- "text": "TCP OK - {0:.3f}s response on port {1}"
- },
- "warning": {
- "text": "TCP OK - {0:.3f}s response on port {1}",
- "value": 1.5
- },
- "critical": {
- "text": "Connection failed: {0} to {1}:{2}",
- "value": 5.0
- }
- }
- }
- }
- ],
"SUPERVISOR": [
{
"name": "storm_supervisor_process",
http://git-wip-us.apache.org/repos/asf/ambari/blob/ceb663e7/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
index 6c7410f..cc7f476 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/STORM/alerts.json
@@ -131,33 +131,6 @@
}
}
],
- "STORM_REST_API": [
- {
- "name": "storm_rest_api",
- "label": "Storm REST API",
- "interval": 1,
- "scope": "ANY",
- "enabled": true,
- "source": {
- "type": "PORT",
- "uri": "8745",
- "default_port": 8745,
- "reporting": {
- "ok": {
- "text": "TCP OK - {0:.3f}s response on port {1}"
- },
- "warning": {
- "text": "TCP OK - {0:.3f}s response on port {1}",
- "value": 1.5
- },
- "critical": {
- "text": "Connection failed: {0} to {1}:{2}",
- "value": 5.0
- }
- }
- }
- }
- ],
"SUPERVISOR": [
{
"name": "storm_supervisor_process",
http://git-wip-us.apache.org/repos/asf/ambari/blob/ceb663e7/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
index a8af259..6511cb4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
@@ -1239,6 +1239,8 @@ public class UpgradeCatalog240Test {
final Clusters mockClusters = easyMockSupport.createStrictMock(Clusters.class);
final Cluster mockClusterExpected = easyMockSupport.createNiceMock(Cluster.class);
final AlertDefinitionEntity namenodeWebUiAlertDefinitionEntity = new AlertDefinitionEntity();
+ final AlertDefinitionEntity mockStormRestApiAlertDefinitionEntity = easyMockSupport.createNiceMock(AlertDefinitionEntity.class);
+
namenodeWebUiAlertDefinitionEntity.setDefinitionName("namenode_webui");
namenodeWebUiAlertDefinitionEntity.setSource("{\"uri\": {\"high_availability\": {\"nameservice\": \"{{hdfs-site/dfs.nameservices}}\",\"alias_key\" : \"{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}\",\"http_pattern\" : \"{{hdfs-site/dfs.namenode.http-address.{{ha-nameservice}}.{{alias}}}}\",\"https_pattern\" : \"{{hdfs-site/dfs.namenode.https-address.{{ha-nameservice}}.{{alias}}}}\"}}}");
@@ -1264,6 +1266,12 @@ public class UpgradeCatalog240Test {
expect(mockAlertDefinitionDAO.findByName(eq(clusterId), eq("namenode_webui")))
.andReturn(namenodeWebUiAlertDefinitionEntity).atLeastOnce();
+ expect(mockAlertDefinitionDAO.findByName(eq(clusterId), eq("storm_rest_api")))
+ .andReturn(mockStormRestApiAlertDefinitionEntity).atLeastOnce();
+
+ mockAlertDefinitionDAO.remove(mockStormRestApiAlertDefinitionEntity);
+ expectLastCall().once();
+
easyMockSupport.replayAll();
mockInjector.getInstance(UpgradeCatalog240.class).updateAlerts();