private void startTopology(String topoName, String topoId, TopologyStatus initStatus, String owner, String principal, Map<String, Object> topoConf, StormTopology stormTopology) throws KeyNotFoundException, AuthorizationException, IOException, InvalidTopologyException { assert (TopologyStatus.ACTIVE == initStatus || TopologyStatus.INACTIVE == initStatus); IStormClusterState state = stormClusterState; Map<String, Integer> numExecutors = new HashMap<>(); StormTopology topology = StormCommon.systemTopology(topoConf, stormTopology); for (Entry<String, Object> entry : StormCommon.allComponents(topology).entrySet()) { numExecutors.put(entry.getKey(), StormCommon.numStartExecutors(entry.getValue())); } LOG.info("Activating {}: {}", topoName, topoId); StormBase base = new StormBase(); base.set_name(topoName); if (topoConf.containsKey(Config.TOPOLOGY_VERSION)) { base.set_topology_version(ObjectReader.getString(topoConf.get(Config.TOPOLOGY_VERSION))); } base.set_launch_time_secs(Time.currentTimeSecs()); base.set_status(initStatus); base.set_num_workers(ObjectReader.getInt(topoConf.get(Config.TOPOLOGY_WORKERS), 0)); base.set_component_executors(numExecutors); base.set_owner(owner); base.set_principal(principal); base.set_component_debug(new HashMap<>()); state.activateStorm(topoId, base, topoConf); idToExecutors.getAndUpdate(new Assoc<>(topoId, new HashSet<>(computeExecutors(topoId, base, topoConf, stormTopology)))); notifyTopologyActionListener(topoName, "activate"); }