Package backtype.storm

Examples of backtype.storm.LocalCluster


    public static void main(String[] args) throws Exception {
        // Storm can be run locally for testing purposes
        Config conf = new Config();
//        conf.put(Config.TOPOLOGY_DEBUG,true);

        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("basic_primitives", conf, basicPrimitives(new FakeTweetsBatchSpout()));
        Thread.sleep(100000);
    }
View Full Code Here


    private static final Logger log = LoggerFactory.getLogger(Part02_AdvancedPrimitives1.class);

    public static void main(String[] args) throws Exception {
        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();
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        FakeTweetGenerator fakeTweets = new FakeTweetGenerator();
        FeederBatchSpout testSpout = new FeederBatchSpout(ImmutableList.of("id", "text", "actor", "location", "date"));

        Config conf = new Config();
        LocalCluster cluster = new LocalCluster();
        LocalDRPC drpc = new LocalDRPC();
        cluster.submitTopology("external_state_drpc", conf, externalState(drpc, testSpout));

        // You can use FeederBatchSpout to feed know values to the topology. Very useful for tests.
        testSpout.feed(fakeTweets.getNextTweetTuples("ted"));
        testSpout.feed(fakeTweets.getNextTweetTuples("ted"));
        testSpout.feed(fakeTweets.getNextTweetTuples("mary"));
View Full Code Here

      StormSubmitter.submitTopology(args[0], conf, builder.createTopology());
    }
    else {
      conf.setMaxTaskParallelism(3);

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

      Thread.sleep(20000);

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

        KestrelThriftSpout spout = new KestrelThriftSpout("localhost", 2229, "test", new StringScheme());
        builder.setSpout("spout", spout).setDebug(true);
        builder.setBolt("bolt", new FailEveryOther())
                .shuffleGrouping("spout");
       
        LocalCluster cluster = new LocalCluster();
        Config conf = new Config();
        cluster.submitTopology("test", conf, builder.createTopology());
       
        Thread.sleep(600000);
    }
View Full Code Here

    @BeforeClass(alwaysRun = true)
    protected void setUp() {
        timer = ServerAndThreadCoordinationUtils.setMaxTimeToRunTimer(getMaxAllowedToRunMillisecs());
        ServerAndThreadCoordinationUtils.removePauseSentinelFile();
        cluster = new LocalCluster();
        ServerAndThreadCoordinationUtils.waitForServerUp("localhost", 2000, 5 * KafkaOutputBoltTest.SECOND);   // Wait for zookeeper to come up

        /*
         *  Below we start up kafka and create topic in a separate thread. If we don't do this then we
         *  get very bizarre behavior, such as tuples never being emitted from our spouts and bolts
View Full Code Here

           
    System.out.println("About to start the cluster");
       
    if (args.length == 0) {
      System.out.println("Working in Local Cluster Mode");
      LocalCluster cluster = new LocalCluster();
      cluster.submitTopology("test", stormconfig, tridentTopology.build());
      System.out.println("Finished submitting local closter");
    } else {
      System.out.println("Starting storm submitter topology");
      System.out.println(" [====] "+tridentTopology);
      stormconfig.setNumWorkers(3);
View Full Code Here

        kafkaConf.scheme = new StringScheme();
        topology.newStream("mykafka", new TransactionalTridentKafkaSpout(kafkaConf))
//                .aggregate(new Count(), new Fields("count"))
                .each(new Fields("str"), new Debug());
       
        LocalCluster cluster = new LocalCluster();
       
        StormTopology topo = topology.build();
       
        cluster.submitTopology("kafkatest", new Config(), topo);
        KillOptions killopts = new KillOptions();
        killopts.set_wait_secs(0);
        Utils.sleep(5000);
        cluster.killTopologyWithOpts("kafkatest", killopts);
        Utils.sleep(5000);

        cluster.submitTopology("kafkatest", new Config(), topo);       
        Utils.sleep(60000);
    }
View Full Code Here

          builder.createTopology());
    } else {

      conf.setDebug(true);

      LocalCluster cluster = new LocalCluster();
      cluster.submitTopology("storm-jms-example", conf, builder.createTopology());
      Utils.sleep(60000);
      cluster.killTopology("storm-jms-example");
      cluster.shutdown();
    }
  }
View Full Code Here

        // Set the consume topic
        conf.put(MetaSpout.TOPIC, "neta-test");
        // Set the max buffer size in bytes to fetch messages.
        conf.put(MetaSpout.FETCH_MAX_SIZE, 1024 * 1024);

        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("test", conf, builder.createTopology());
    }
View Full Code Here

TOP

Related Classes of backtype.storm.LocalCluster

Copyright © 2018 www.massapicom. 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.