Thanks Nathan, it worked out..!!!!
On Wed, Jun 18, 2014 at 6:23 PM, Nathan Leung <[email protected]> wrote: > If you kill a topology in the ui, you will notice that sometimes it takes > awhile for it to clear and go away. If you try to reload the topology > during this time you will get the same exception. You should loop checking > the nimbus for this topology after you kill it, and only reload after you > detect that it has gone away. > On Jun 18, 2014 3:25 AM, "Nishu" <[email protected]> wrote: > >> Hi, >> >> I need to update a running topology on some user action. >> So I have used following way in the topology : Killing the running >> topology and again starting it >> >> NimbusClient client = >>> NimbusClient.getConfiguredClient(conf); >>> try { >>> ClusterSummary summary = client.getClient().getClusterInfo(); >>> for (TopologySummary s : summary.get_topologies()) { >>> if (s.get_name().equals(name)) { >>> client.killTopology(name); >>> return true; >>> } >>> } >>> return false; >>> } >>> StormSubmitter.submitTopology(topologyName, >>> conf,builder.createTopology()); >> >> >> >> What happens here is : Topology is killed by the client, but when >> Stormsubmitter submits the same topology, it gets exception for duplicate >> topology name like below: >> >> Exception in thread "main" java.lang.RuntimeException: Topology with name >>> `test_topology` already exists on cluster >>> at >>> backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:89) >>> at >>> backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:58) >>> at com.cts.TestTopology.main(TestTopology.java:131) >> >> >> >> What should I use to overcome this problem? or is there another way to >> update the running topology? >> >> Thanks, >> Nishu Tayal >> > -- with regards, Nishu Tayal
