You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ji...@apache.org on 2016/12/02 02:20:29 UTC
incubator-eagle git commit: [MINOR] avoid adding duplicated
publishment in spec
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 <xi...@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 <xi...@ebay.com>
Authored: Fri Dec 2 10:20:22 2016 +0800
Committer: wujinhu <wu...@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() {