Github user revans2 commented on a diff in the pull request:
https://github.com/apache/incubator-storm/pull/38#discussion_r10302462
--- Diff: storm-core/src/jvm/backtype/storm/spout/ShellSpout.java ---
@@ -92,6 +99,49 @@ public void fail(Object msgId) {
_fail.put("id", msgId);
querySubprocess(_fail);
}
+
+ private void handleMetrics(Map action) {
+ //get metrics
+ Object nameObj = action.get("name");
+ if ( !(nameObj instanceof String) ) {
+ throw new RuntimeException("Receive Metrics name is not
String");
+ }
+ String name = (String) nameObj;
+ if (name == null || name.isEmpty()) {
+ throw new RuntimeException("Receive Metrics name is
NULL");
+ }
+ if ( !_registeredShellMetrics.containsKey(name)) {
+ throw new RuntimeException("Receive Metrics name:" +
name + " does not reigster.");
+ }
+ IShellMetric iMetric = _registeredShellMetrics.get(name);
+
+ //get paramList
+ Object paramsObj = action.get("params");
+
+ Class<? extends IShellMetric> oriClass = iMetric.getClass();
--- End diff --
Why do we need all of this? Shouldn't it just be
```java
try {
iMetric.updateMetricFromRPC(paramsObj);
} catch (Exception e) {
throw new RuntimeException(e);
}
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---