Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9D736200BD4 for ; Fri, 2 Dec 2016 03:20:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9BE37160B10; Fri, 2 Dec 2016 02:20:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E49D4160B0B for ; Fri, 2 Dec 2016 03:20:38 +0100 (CET) Received: (qmail 17507 invoked by uid 500); 2 Dec 2016 02:20:37 -0000 Mailing-List: contact commits-help@eagle.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@eagle.incubator.apache.org Delivered-To: mailing list commits@eagle.incubator.apache.org Received: (qmail 17498 invoked by uid 99); 2 Dec 2016 02:20:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 02:20:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3DE3A180652 for ; Fri, 2 Dec 2016 02:20:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id xx6wgIn_-mCa for ; Fri, 2 Dec 2016 02:20:36 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 53D275F4AC for ; Fri, 2 Dec 2016 02:20:30 +0000 (UTC) Received: (qmail 17368 invoked by uid 99); 2 Dec 2016 02:20:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 02:20:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3A8DCE69B1; Fri, 2 Dec 2016 02:20:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jinhuwu@apache.org To: commits@eagle.incubator.apache.org Message-Id: <57e4613b373947bd985ca3ff93e774ac@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-eagle git commit: [MINOR] avoid adding duplicated publishment in spec Date: Fri, 2 Dec 2016 02:20:29 +0000 (UTC) archived-at: Fri, 02 Dec 2016 02:20:39 -0000 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 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 Authored: Fri Dec 2 10:20:22 2016 +0800 Committer: wujinhu 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() {