You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ha...@apache.org on 2016/10/23 13:04:46 UTC

incubator-eagle git commit: [MINOR] Register StormMetricTaggedConsumer only when metric.sink exists

Repository: incubator-eagle
Updated Branches:
  refs/heads/master 435451eff -> 8bd30aec1


[MINOR] Register StormMetricTaggedConsumer only when metric.sink exists


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

Branch: refs/heads/master
Commit: 8bd30aec1e75f964a0e45af605f37e1b672ba312
Parents: 435451e
Author: Hao Chen <ha...@apache.org>
Authored: Sun Oct 23 21:04:33 2016 +0800
Committer: Hao Chen <ha...@apache.org>
Committed: Sun Oct 23 21:04:33 2016 +0800

----------------------------------------------------------------------
 .../apache/eagle/app/environment/impl/StormExecutionRuntime.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8bd30aec/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
index ccfcd93..4a9b2b7 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
@@ -23,6 +23,7 @@ import backtype.storm.utils.NimbusClient;
 import com.google.common.base.Preconditions;
 import com.typesafe.config.ConfigRenderOptions;
 import org.apache.eagle.alert.engine.runner.StormMetricTaggedConsumer;
+import org.apache.eagle.alert.metric.MetricConfigs;
 import org.apache.eagle.app.Application;
 import org.apache.eagle.app.environment.ExecutionRuntime;
 import org.apache.eagle.app.environment.ExecutionRuntimeProvider;
@@ -61,7 +62,6 @@ public class StormExecutionRuntime implements ExecutionRuntime<StormEnvironment,
     }
 
     public static final String TOPOLOGY_MESSAGE_TIMEOUT_SECS = "topology.message.timeout.secs";
-    public static final String METRIC_CONFIG_PREFIX = "metric";
 
     private static final String STORM_NIMBUS_HOST_CONF_PATH = "application.storm.nimbusHost";
     private static final String STORM_NIMBUS_HOST_DEFAULT = "localhost";
@@ -103,7 +103,7 @@ public class StormExecutionRuntime implements ExecutionRuntime<StormEnvironment,
             conf.put(TOPOLOGY_MESSAGE_TIMEOUT_SECS, config.getInt(TOPOLOGY_MESSAGE_TIMEOUT_SECS));
         }
 
-        if (config.hasPath(METRIC_CONFIG_PREFIX)) {
+        if (config.hasPath(MetricConfigs.METRIC_SINK_CONF)) {
             conf.registerMetricsConsumer(StormMetricTaggedConsumer.class, config.root().render(ConfigRenderOptions.concise()), 1);
         }
         return conf;