You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ra...@apache.org on 2016/11/09 02:43:08 UTC

[1/2] incubator-eagle git commit: EAGLE-755: Publishment without streamIds update encountered NPE

Repository: incubator-eagle
Updated Branches:
  refs/heads/master 60206b5b5 -> 6ec928941


EAGLE-755: Publishment without streamIds update encountered NPE

Author: Li, Garrett
Reviewer: ralphsu

This closes #629


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

Branch: refs/heads/master
Commit: bd5f242307fa184b9e8f272a862d7468e4dedd23
Parents: 60206b5
Author: Zhao, Qingwen <qi...@apache.org>
Authored: Tue Nov 8 21:16:53 2016 +0800
Committer: Ralph, Su <su...@gmail.com>
Committed: Wed Nov 9 10:19:10 2016 +0800

----------------------------------------------------------------------
 .../eagle/alert/engine/publisher/impl/AlertPublisherImpl.java     | 3 ++-
 .../alert-engine/src/test/resources/testPublishSpec3.json         | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/bd5f2423/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
index ddb4a21..a4038e7 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
@@ -35,6 +35,7 @@ import org.apache.eagle.alert.engine.publisher.AlertPublisher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Objects;
 import com.typesafe.config.Config;
 
 @SuppressWarnings("rawtypes")
@@ -167,7 +168,7 @@ public class AlertPublisherImpl implements AlertPublisher {
             List<String> oldPolicies = beforeModified.get(i).getPolicyIds();
             List<String> oldStreams = beforeModified.get(i).getStreamIds();
 
-            if (!newPolicies.equals(oldPolicies) || !newStreams.equals(oldStreams)) {
+            if (!newPolicies.equals(oldPolicies) || !Objects.equal(newStreams, oldStreams)) {
                 // since both policy & stream may change, skip the compare and difference update
                 removePublihsPoliciesStreams(newPSPublishPluginMapping, oldPolicies, pubName);
                 addPublishmentPoliciesStreams(newPSPublishPluginMapping, newPolicies, newStreams, pubName);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/bd5f2423/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/testPublishSpec3.json
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/testPublishSpec3.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/testPublishSpec3.json
index 0bf0e2a..0de8218 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/testPublishSpec3.json
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/testPublishSpec3.json
@@ -9,9 +9,6 @@
       "policyIds": [
         "policy1"
       ],
-      "streamIds": [
-        "stream2"
-      ],
       "dedupIntervalMin": "PT2M",
       "properties": {
         "subject": "Test Alert",


[2/2] incubator-eagle git commit: EAGLE-756: make sure publish change is sent to runtime bolts

Posted by ra...@apache.org.
EAGLE-756: make sure publish change is sent to runtime bolts

Author: Zeng, Bryant
Reviewer: ralphsu

This closes #630


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

Branch: refs/heads/master
Commit: 6ec928941364bcb565ec2b20d6da20336aaa3578
Parents: bd5f242
Author: mizeng <mi...@ebaysf.com>
Authored: Tue Nov 8 15:37:39 2016 -0800
Committer: Ralph, Su <su...@gmail.com>
Committed: Wed Nov 9 10:30:42 2016 +0800

----------------------------------------------------------------------
 .../eagle/alert/engine/publisher/impl/AlertPublisherImpl.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6ec92894/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
index a4038e7..7cb4a73 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
@@ -174,7 +174,10 @@ public class AlertPublisherImpl implements AlertPublisher {
                 addPublishmentPoliciesStreams(newPSPublishPluginMapping, newPolicies, newStreams, pubName);
             }
             Publishment newPub = afterModified.get(i);
-            newPublishMap.get(pubName).update(newPub.getDedupIntervalMin(), newPub.getProperties());
+
+            // for updated publishment, need to init them too
+            AlertPublishPlugin newPlugin = AlertPublishPluginsFactory.createNotificationPlugin(newPub, config, conf);
+            newPublishMap.replace(pubName, newPlugin);
         }
 
         // now do the swap