[ 
https://issues.apache.org/jira/browse/STORM-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14213868#comment-14213868
 ] 

zhangjinlong commented on STORM-554:
------------------------------------

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]
  (recursive-map
    :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.

> the "get-task-object" function in task.clj,the type of first param "topology" 
> should be ^StormTopology not ^TopologyContext
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: STORM-554
>                 URL: https://issues.apache.org/jira/browse/STORM-554
>             Project: Apache Storm
>          Issue Type: Bug
>    Affects Versions: 0.9.3-rc2
>            Reporter: zhangjinlong
>            Assignee: zhangjinlong
>             Fix For: 0.9.3-rc2
>
>
> the "get-task-object" function in task.clj,the type of first param "topology" 
> should be ^StormTopology not ^TopologyContext



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to