Executing the topology

The OutbreakDetectionTopology class has the following main method:

public static void main(String[] args) throws Exception {
    Config conf = new Config();
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("cdc", conf, buildTopology());
    Thread.sleep(200000);
    cluster.shutdown();
}

Executing this method will submit the topology to a local cluster. The spout will immediately start emitting diagnosis events, which the Count aggregator will collect. The threshold in the OutbreakDetector class is set such that the count will quickly exceed the threshold, at which point the program terminates with the following set of commands:

INFO [Thread-18] DefaultCoordinator.success(31) | Successful Transaction [8]
INFO [Thread-18] ...

Get Storm Blueprints: Patterns for Distributed Real-time Computation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.