()
| 259 | } |
| 260 | |
| 261 | private Object mkTaskObject() { |
| 262 | StormTopology topology = systemTopologyContext.getRawTopology(); |
| 263 | Map<String, SpoutSpec> spouts = topology.get_spouts(); |
| 264 | Map<String, Bolt> bolts = topology.get_bolts(); |
| 265 | Map<String, StateSpoutSpec> stateSpouts = topology.get_state_spouts(); |
| 266 | Object result; |
| 267 | ComponentObject componentObject; |
| 268 | if (spouts.containsKey(componentId)) { |
| 269 | componentObject = spouts.get(componentId).get_spout_object(); |
| 270 | } else if (bolts.containsKey(componentId)) { |
| 271 | componentObject = bolts.get(componentId).get_bolt_object(); |
| 272 | } else if (stateSpouts.containsKey(componentId)) { |
| 273 | componentObject = stateSpouts.get(componentId).get_state_spout_object(); |
| 274 | } else { |
| 275 | throw new RuntimeException("Could not find " + componentId + " in " + topology); |
| 276 | } |
| 277 | result = Utils.getSetComponentObject(componentObject); |
| 278 | |
| 279 | if (result instanceof ShellComponent) { |
| 280 | if (spouts.containsKey(componentId)) { |
| 281 | result = new ShellSpout((ShellComponent) result); |
| 282 | } else { |
| 283 | result = new ShellBolt((ShellComponent) result); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | if (result instanceof JavaObject) { |
| 288 | result = Thrift.instantiateJavaObject((JavaObject) result); |
| 289 | } |
| 290 | |
| 291 | return result; |
| 292 | } |
| 293 | |
| 294 | private void addTaskHooks() { |
| 295 | List<String> hooksClassList = (List<String>) topoConf.get(Config.TOPOLOGY_AUTO_TASK_HOOKS); |
no test coverage detected