storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From revans2 <...@git.apache.org>
Subject [GitHub] incubator-storm pull request: STORM-200 Proposal for Multilang's M...
Date Tue, 25 Feb 2014 16:19:37 GMT
Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/38#discussion_r10042235
  
    --- Diff: storm-core/src/jvm/backtype/storm/task/ShellBolt.java ---
    @@ -238,6 +256,46 @@ private void handleEmit(Map action) throws InterruptedException {
                 _collector.emitDirect((int)task.longValue(), stream, anchors, tuple);
             }
         }
    +    
    +    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.");
    +    	}
    +    	IMetric iMetric = _registeredShellMetrics.get(name);
    +    	
    +    	//get paramList
    +    	Object paramsObj = action.get("params");
    +    	if ( !(paramsObj instanceof List) ) {
    +    		throw new RuntimeException("Receive Metrics name:" + name + " params is not list.");
    +    	}
    +    	List<Object> params = (List) paramsObj;
    +    	for (Object o : params) {
    --- End diff --
    
    Is this check really needed? Metrics can be any object why not allow that here too?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message