ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpapirkovs...@apache.org
Subject [2/2] ambari git commit: AMBARI-12046. Aggregate alerts not working. (mpapirkovskyy)
Date Sun, 21 Jun 2015 08:17:15 GMT
AMBARI-12046. Aggregate alerts not working. (mpapirkovskyy)


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

Branch: refs/heads/branch-2.1
Commit: 60412db3a99f9b59e5e4259916b36b6721150713
Parents: 5e8e94c
Author: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Authored: Sun Jun 21 11:15:08 2015 +0300
Committer: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Committed: Sun Jun 21 11:16:02 2015 +0300

----------------------------------------------------------------------
 .../apache/ambari/server/alerts/AgentHeartbeatAlertRunnable.java | 1 +
 .../java/org/apache/ambari/server/alerts/StaleAlertRunnable.java | 1 +
 .../server/events/listeners/alerts/AlertReceivedListener.java    | 4 ++--
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/60412db3/ambari-server/src/main/java/org/apache/ambari/server/alerts/AgentHeartbeatAlertRunnable.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/alerts/AgentHeartbeatAlertRunnable.java
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/AgentHeartbeatAlertRunnable.java
index da4a0c1..0611e23 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/alerts/AgentHeartbeatAlertRunnable.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/alerts/AgentHeartbeatAlertRunnable.java
@@ -170,6 +170,7 @@ public class AgentHeartbeatAlertRunnable implements Runnable {
           alert.setLabel(entity.getLabel());
           alert.setText(alertText);
           alert.setTimestamp(alertTimestamp);
+          alert.setCluster(cluster.getClusterName());
 
           AlertReceivedEvent event = new AlertReceivedEvent(
               cluster.getClusterId(), alert);

http://git-wip-us.apache.org/repos/asf/ambari/blob/60412db3/ambari-server/src/main/java/org/apache/ambari/server/alerts/StaleAlertRunnable.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/alerts/StaleAlertRunnable.java
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/StaleAlertRunnable.java
index e23dd62..206b2ca 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/alerts/StaleAlertRunnable.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/alerts/StaleAlertRunnable.java
@@ -197,6 +197,7 @@ public class StaleAlertRunnable implements Runnable {
         alert.setLabel(entity.getLabel());
         alert.setText(alertText);
         alert.setTimestamp(now);
+        alert.setCluster(cluster.getClusterName());
 
         AlertReceivedEvent event = new AlertReceivedEvent(
             cluster.getClusterId(), alert);

http://git-wip-us.apache.org/repos/asf/ambari/blob/60412db3/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
index 0dd14cb..b4d4302 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
@@ -123,8 +123,8 @@ public class AlertReceivedListener {
 
       Long clusterId = getClusterIdByName(alert.getCluster());
       if (clusterId == null) {
-        LOG.warn("Null cluster id is not supported for alerts as of now"); //based on listener
implementation
-        continue;
+        //check event
+        clusterId = event.getClusterId();
       }
 
       AlertDefinitionEntity definition = m_definitionDao.findByName(clusterId,


Mime
View raw message