Package backtype.storm

Examples of backtype.storm.LocalCluster.shutdown()


        config.setMaxSpoutPending(3);
       
        cluster.submitTopology("top-n-topology", config, builder.buildTopology());
       
        Thread.sleep(3000);
        cluster.shutdown();
    }
}
View Full Code Here


        System.out.println("REACH: " + drpc.execute("reach", "aaa"));
        System.out.println("REACH: " + drpc.execute("reach", "foo.com/blog/1"));
        System.out.println("REACH: " + drpc.execute("reach", "engineering.twitter.com/blog/5"));


        cluster.shutdown();
        drpc.shutdown();
    }
}
View Full Code Here

            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("word-count", conf, builder.createTopology());
       
            Thread.sleep(10000);

            cluster.shutdown();
        }
    }
}
View Full Code Here

        config.setMaxSpoutPending(3);
       
        cluster.submitTopology("global-count-topology", config, builder.buildTopology());
       
        Thread.sleep(3000);
        cluster.shutdown();
    }
}
View Full Code Here

            throws InterruptedException {
        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology(topologyName, conf, topology);
        Thread.sleep((long) runtimeInSeconds * MILLIS_IN_SEC);
        cluster.killTopology(topologyName);
        cluster.shutdown();
    }
}
View Full Code Here

        for(int i=9; i>=0; i--) {           
            ageSpout.feed(new Values(i, i+20));
        }
       
        Utils.sleep(2000);
        cluster.shutdown();
    }
}
View Full Code Here

        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("test", conf, builder.createTopology());
        Utils.sleep(120000);
        cluster.killTopology("test");
        cluster.shutdown();
    }

}
View Full Code Here

            cluster.submitTopology("test topology", conf, topology);

            Runtime.getRuntime().addShutdownHook(new Thread() {
                public void run() {
                    System.out.println("Shutting down local topology");
                    cluster.shutdown();
                }
            });   

            while (true)
            {
View Full Code Here

        cluster.submitTopology("test", conf, builder.createTopology());

        // for testing, just leave up for 10 mins then kill it all
        Utils.sleep(10 * 60 * 1000); // 10 mins
        cluster.killTopology("test");
        cluster.shutdown();
    }

    private static IRichSpout createKafkaSpout() {

        // setup Kafka consumer
View Full Code Here

        Config conf = new Config();
//        conf.put(Config.TOPOLOGY_DEBUG,true);
        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("advanced_primitives", conf, advancedPrimitives(new FakeTweetsBatchSpout(1000)));
        Thread.sleep(30000);
        cluster.shutdown();
    }

    private static StormTopology advancedPrimitives(FakeTweetsBatchSpout spout) {

        TridentTopology topology = new TridentTopology();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.