storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [1/4] storm git commit: Update "get-task-object" function in task.clj
Date Thu, 05 Mar 2015 15:51:55 GMT
Repository: storm
Updated Branches:
  refs/heads/master 2dbeb98ad -> 5eff2e761

Update "get-task-object" function in task.clj

Update "get-task-object" function, change the type of first param "topology" from ^TopologyContext
to ^StormTopology. the "get-task-object" function in task.clj,the type of first param "topology"
should be ^StormTopology not ^TopologyContext.

the "get-task-object" is called by "mk-task-data" function in task.clj, "mk-task-data" is
defined as following:

(defn mk-task-data [executor-data task-id]
    :executor-data executor-data
    :task-id task-id
    :system-context (system-topology-context (:worker executor-data) executor-data task-id)
    :user-context (user-topology-context (:worker executor-data) executor-data task-id)
    :builtin-metrics (builtin-metrics/make-data (:type executor-data))
    :tasks-fn (mk-tasks-fn <>)
    :object (get-task-object (.getRawTopology ^TopologyContext (:system-context <>))
(:component-id executor-data))))

(:system-context <>) return TopologyContext instance, TopologyContext extends GeneralTopologyContext,
the TopologyContext instance has StormTopology _topology. “getRawTopology” method of TopologyContext
must return StormTopology _topology. (.getRawTopology ^TopologyContext (:system-context <>)
return StormTopology instance not TopologyContext instance. so the type of param topology
is StormTopology not TopologyContext.

at the same time, "get-task-object" call "get_spouts" and "get_bolts" of the param topology.
you can find the "get_spouts" and "get_bolts" function are only defined in StormTopology,
and StormTopology is not a subclass of TopologyContext. so i think the type of param topology
is StormTopology not TopologyContext.


Branch: refs/heads/master
Commit: 0ee865750e8d54c00d2abac81c20c429483bc646
Parents: 8036109
Author: zhangjinlong <>
Authored: Mon Feb 16 13:49:06 2015 +0800
Committer: zhangjinlong <>
Committed: Mon Feb 16 13:49:06 2015 +0800

 storm-core/src/clj/backtype/storm/daemon/task.clj | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/storm-core/src/clj/backtype/storm/daemon/task.clj b/storm-core/src/clj/backtype/storm/daemon/task.clj
index 6a61cea..a08ba3c 100644
--- a/storm-core/src/clj/backtype/storm/daemon/task.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/task.clj
@@ -61,7 +61,7 @@
     (:topology worker))
-(defn- get-task-object [^TopologyContext topology component-id]
+(defn- get-task-object [^StormTopology topology component-id]
   (let [spouts (.get_spouts topology)
         bolts (.get_bolts topology)
         state-spouts (.get_state_spouts topology)

View raw message