eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinh...@apache.org
Subject eagle git commit: [MINOR] fix null pointer exception for sla jobs
Date Tue, 07 Mar 2017 05:52:45 GMT
Repository: eagle
Updated Branches:
  refs/heads/master d766f6815 -> af6dd7d4c


[MINOR] fix null pointer exception for sla jobs

Author: wujinhu <wujinhu920@126.com>

Closes #857 from wujinhu/EAGLE-849.


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

Branch: refs/heads/master
Commit: af6dd7d4c039d5a55cf223102a05693e7c26adea
Parents: d766f68
Author: wujinhu <wujinhu920@126.com>
Authored: Tue Mar 7 13:52:39 2017 +0800
Committer: wujinhu <wujinhu920@126.com>
Committed: Tue Mar 7 13:52:39 2017 +0800

----------------------------------------------------------------------
 .../apache/eagle/jpm/analyzer/publisher/EmailPublisher.java    | 6 ++++++
 .../jpm/analyzer/publisher/dedup/impl/SimpleDeduplicator.java  | 4 ++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/af6dd7d4/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/EmailPublisher.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/EmailPublisher.java
b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/EmailPublisher.java
index 471dbf8..737279f 100644
--- a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/EmailPublisher.java
+++ b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/EmailPublisher.java
@@ -57,6 +57,12 @@ public class EmailPublisher implements Publisher, Serializable {
             return;
         }
 
+        if (analyzerJobEntity.getJobMeta() == null) {
+            //do not need send email
+            //TODO, framework should know which publishers that job should uses. Just work
around here
+            return;
+        }
+
         LOG.info("EmailPublisher gets job {}", analyzerJobEntity.getJobDefId());
 
         Map<String, String> basic = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/eagle/blob/af6dd7d4/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/dedup/impl/SimpleDeduplicator.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/dedup/impl/SimpleDeduplicator.java
b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/dedup/impl/SimpleDeduplicator.java
index f8155f1..48cd577 100644
--- a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/dedup/impl/SimpleDeduplicator.java
+++ b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/publisher/dedup/impl/SimpleDeduplicator.java
@@ -39,6 +39,10 @@ public class SimpleDeduplicator implements AlertDeduplicator, Serializable
{
     @Override
     public boolean dedup(AnalyzerEntity analyzerJobEntity, Result result) {
         synchronized (lastUpdateTime) {
+            if (analyzerJobEntity.getJobMeta() == null || analyzerJobEntity.getJobMeta().getConfiguration()
== null) {
+                return false;
+            }
+
             long dedupInterval = Constants.DEFAULT_DEDUP_INTERVAL;
             if (analyzerJobEntity.getJobMeta().getConfiguration().containsKey(Constants.DEDUP_INTERVAL_KEY))
{
                 dedupInterval = (Integer)analyzerJobEntity.getJobMeta().getConfiguration().get(Constants.DEDUP_INTERVAL_KEY);


Mime
View raw message