Package backtype.storm

Examples of backtype.storm.LocalCluster.submitTopology()


        // 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);
    }

    public static StormTopology basicPrimitives(IBatchSpout spout) throws IOException {
View Full Code Here


    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();
    }

    private static StormTopology advancedPrimitives(FakeTweetsBatchSpout spout) {
View Full Code Here

        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

    }
    else {
      conf.setMaxTaskParallelism(3);

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

      Thread.sleep(20000);

      cluster.shutdown();
    }
View Full Code Here

        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

    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

       
        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);
View Full Code Here

        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

    } 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

        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
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.