storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [1/4] git commit: STORM-66 send taskid on initial handshake
Date Thu, 12 Jun 2014 21:48:18 GMT
Repository: incubator-storm
Updated Branches:
  refs/heads/master 2bad66eae -> 61a4eac59


STORM-66 send taskid on initial handshake


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

Branch: refs/heads/master
Commit: 47dba860094bbe381e0bd231a43e2501a98a855b
Parents: 254ec13
Author: David Losada <david@tuxpiper.com>
Authored: Sun Feb 16 21:55:45 2014 +0100
Committer: David Losada <david@tuxpiper.com>
Committed: Sun Feb 16 21:55:45 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/47dba860/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 c9df979..f540e90 100644
--- a/storm-core/src/jvm/backtype/storm/task/TopologyContext.java
+++ b/storm-core/src/jvm/backtype/storm/task/TopologyContext.java
@@ -37,6 +37,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import org.apache.commons.lang.NotImplementedException;
+import org.json.simple.JSONValue;
 
 /**
  * A TopologyContext is given to bolts and spouts in their "prepare" and "open"
@@ -217,6 +218,16 @@ public class TopologyContext extends WorkerTopologyContext implements
IMetricsCo
     public Collection<ITaskHook> getHooks() {
         return _hooks;
     }
+    
+    @Override
+    public String toJSONString() {
+        Map obj = new HashMap();
+        obj.put("task->component", this.getTaskToComponent());
+        obj.put("taskid", this.getThisTaskId());
+        // TODO: jsonify StormTopology
+        // at the minimum should send source info
+        return JSONValue.toJSONString(obj);
+    }
 
     /*
      * Register a IMetric instance. 


Mime
View raw message