eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinh...@apache.org
Subject incubator-eagle git commit: [MINOR] avoid adding duplicated publishment in spec
Date Fri, 02 Dec 2016 02:20:29 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master c52e23c74 -> a0f134422


[MINOR] avoid adding duplicated publishment in spec

Although duplicated publisher won't impact anything since we convert it to map and publisher
name is the key, avoid duplicated publisher in schedule state is meaningful.

Author: Xiancheng Li <xiancheng.li@ebay.com>

Closes #707 from garrettlish/pub.


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

Branch: refs/heads/master
Commit: a0f134422dbab0c4a98bd181b75f78cf7a8c3343
Parents: c52e23c
Author: Xiancheng Li <xiancheng.li@ebay.com>
Authored: Fri Dec 2 10:20:22 2016 +0800
Committer: wujinhu <wujinhu920@126.com>
Committed: Fri Dec 2 10:20:22 2016 +0800

----------------------------------------------------------------------
 .../apache/eagle/alert/coordination/model/PublishSpec.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/a0f13442/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/PublishSpec.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/PublishSpec.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/PublishSpec.java
index c1f9b24..e38ee97 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/PublishSpec.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/coordination/model/PublishSpec.java
@@ -17,6 +17,9 @@
 package org.apache.eagle.alert.coordination.model;
 
 import org.apache.eagle.alert.engine.coordinator.Publishment;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -37,8 +40,11 @@ public class PublishSpec {
         this.boltId = boltId;
     }
 
+    @JsonIgnore
     public void addPublishment(Publishment p) {
-        this.publishments.add(p);
+        if (!this.publishments.contains(p)) {
+            this.publishments.add(p);
+        }
     }
 
     public String getTopologyName() {


Mime
View raw message