要杀死拓扑,您可以尝试以下方法
import backtype.storm.generated.KillOptionsimport backtype.storm.generated.Nimbus.Client;import backtype.storm.utils.NimbusClientimport backtype.storm.utils.UtilsMap conf = Utils.readStormConfig();Client client = NimbusClient.getConfiguredClient(conf).getClient();KillOptions killOpts = new KillOptions();//killOpts.set_wait_secs(waitSeconds); // time to wait before killingclient.killTopologyWithOpts(topology_name, killOpts); //provide topology name
获取拓扑运行状态
Client client = NimbusClient.getConfiguredClient(conf).getClient();List<TopologySummary> topologyList = client.getClusterInfo.get_topologies();// loop through the list and check if the required topology name is present in the list// if not it's not running



