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 76B3E200D5D for ; Wed, 20 Dec 2017 17:13:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 74F79160C0A; Wed, 20 Dec 2017 16:13:36 +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 B07C4160C2C for ; Wed, 20 Dec 2017 17:13:35 +0100 (CET) Received: (qmail 57872 invoked by uid 500); 20 Dec 2017 16:13:34 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 57859 invoked by uid 99); 20 Dec 2017 16:13:34 -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; Wed, 20 Dec 2017 16:13:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 97445E04DB; Wed, 20 Dec 2017 16:13:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aledsage@apache.org To: commits@brooklyn.apache.org Date: Wed, 20 Dec 2017 16:13:36 -0000 Message-Id: <562de27a259640898f03754490f5337e@git.apache.org> In-Reply-To: <481b61884a3441058b342f6d1844edcb@git.apache.org> References: <481b61884a3441058b342f6d1844edcb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/5] brooklyn-server git commit: Review comments archived-at: Wed, 20 Dec 2017 16:13:36 -0000 Review comments Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/61db8346 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/61db8346 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/61db8346 Branch: refs/heads/master Commit: 61db8346a2646c1934cbf7b8918a711c49dcad3f Parents: 39e822f Author: graeme.miller Authored: Wed Dec 20 14:44:48 2017 +0000 Committer: graeme.miller Committed: Wed Dec 20 14:44:48 2017 +0000 ---------------------------------------------------------------------- .../brooklyn/enricher/stock/aggregator/AggregationJob.java | 3 +++ .../enricher/stock/aggregator/DashboardAggregator.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/61db8346/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/AggregationJob.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/AggregationJob.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/AggregationJob.java index 641325c..ed8c006 100644 --- a/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/AggregationJob.java +++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/AggregationJob.java @@ -26,9 +26,12 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; +import com.google.common.annotations.Beta; + import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey; +@Beta public final class AggregationJob implements Runnable { public static BasicAttributeSensorAndConfigKey> DASHBOARD_COST_PER_MONTH = new BasicAttributeSensorAndConfigKey(Map.class, http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/61db8346/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/DashboardAggregator.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/DashboardAggregator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/DashboardAggregator.java index f8e9775..de9964b 100644 --- a/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/DashboardAggregator.java +++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/aggregator/DashboardAggregator.java @@ -21,6 +21,8 @@ package org.apache.brooklyn.enricher.stock.aggregator; import java.util.Map; import java.util.concurrent.Callable; +import com.google.common.annotations.Beta; + import org.apache.brooklyn.api.entity.EntityLocal; import org.apache.brooklyn.api.mgmt.Task; import org.apache.brooklyn.core.enricher.AbstractEnricher; @@ -38,12 +40,13 @@ import org.apache.brooklyn.util.time.Duration; * The reason that this exists is to provide high level summary information, that could be useful to display on a dashboard. * Whilst brooklyn itself has no such dashboard, we can imagine this entity being used in that fashion. * - * Please note, that the DashboardAggregator will aggregate all children of the entity it is attached to, even intermediate level children. + * Please note, that the DashboardAggregator will aggregate all descendants of the entity it is attached to, even intermediate level children. * Therefore, please only ever attach one DashboardAggregator to the top most entity. * * For a detailed list of the config that is combined, please see the AggregationJob class. * */ +@Beta public class DashboardAggregator extends AbstractEnricher { private ScheduledTask task; @@ -76,6 +79,8 @@ public class DashboardAggregator extends AbstractEnricher { @Override public void destroy() { super.destroy(); - task.cancel(); + if (task != null) { + task.cancel(); + } } } \ No newline at end of file