storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [1/3] git commit: resolve storm-254, fobbiden to register same name metrics in different timeBucket
Date Mon, 21 Jul 2014 16:22:55 GMT
Repository: incubator-storm
Updated Branches:
  refs/heads/master 85c9cd5ae -> 48cc069ae


resolve storm-254, fobbiden to register same name metrics in different timeBucket


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

Branch: refs/heads/master
Commit: f8c9995ac7f1d5fcdd19b3d0f67f0abd111f320e
Parents: 8da9572
Author: dashengju <dashengju@qq.com>
Authored: Wed Jul 2 23:32:30 2014 +0800
Committer: dashengju <dashengju@qq.com>
Committed: Wed Jul 2 23:32:30 2014 +0800

----------------------------------------------------------------------
 storm-core/src/jvm/backtype/storm/task/TopologyContext.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f8c9995a/storm-core/src/jvm/backtype/storm/task/TopologyContext.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/task/TopologyContext.java b/storm-core/src/jvm/backtype/storm/task/TopologyContext.java
index 356edb3..4cac3b6 100644
--- a/storm-core/src/jvm/backtype/storm/task/TopologyContext.java
+++ b/storm-core/src/jvm/backtype/storm/task/TopologyContext.java
@@ -251,6 +251,10 @@ public class TopologyContext extends WorkerTopologyContext implements
IMetricsCo
                                                "greater than or equal to 1 second.");
         }
         
+        if (getRegisteredMetricByName(name) != null) {
+            throw new RuntimeException("The same metric name `" + name + "` was registered
twice." );
+        }
+
         Map m1 = _registeredMetrics;
         if(!m1.containsKey(timeBucketSizeInSecs)) {
             m1.put(timeBucketSizeInSecs, new HashMap());


Mime
View raw message