Github user dashengju commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/38#discussion_r10329469
  
    --- 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 --
    
    thanks for your reminding. 
    At first, we want the rpc call is : <method-name, method-params>, then we 
use java's reflection to call "method-name" method.
    But now, we define a interface  updateMetricFromRPC, so we do not need 
reflection any more.


---
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.
---

Reply via email to