Package backtype.storm

Examples of backtype.storm.Config


                .fieldsGrouping("bucketize", new Fields("bucket"));
       
       
        LocalCluster cluster = new LocalCluster();
       
        Config config = new Config();
        config.setDebug(true);
        config.setMaxSpoutPending(3);
       
        cluster.submitTopology("top-n-topology", config, builder.buildTopology());
       
        Thread.sleep(3000);
        cluster.shutdown();
View Full Code Here


    }

    public static void main(String[] args) throws Exception {
        LocalDRPC drpc = new LocalDRPC();

        Config conf = new Config();
        LocalCluster cluster = new LocalCluster();

        cluster.submitTopology("reach", conf, buildTopology(drpc));

        Thread.sleep(2000);
View Full Code Here

        builder.setBolt("split", new SplitSentence(), 8)
                 .shuffleGrouping("spout");
        builder.setBolt("count", new WordCount(), 12)
                 .fieldsGrouping("split", new Fields("word"));

        Config conf = new Config();
        conf.setDebug(true);

       
        if(args!=null && args.length > 0) {
            conf.setNumWorkers(3);
           
            StormSubmitter.submitTopology(args[0], conf, builder.createTopology());
        } else {       
            conf.setMaxTaskParallelism(3);

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

                .shuffleGrouping("drpc");
        builder.setBolt("return", new ReturnResults(), 3)
                .shuffleGrouping("exclaim");
       
        LocalCluster cluster = new LocalCluster();
        Config conf = new Config();
        cluster.submitTopology("exclaim", conf, builder.createTopology());
       
        System.out.println(drpc.execute("exclamation", "aaa"));
        System.out.println(drpc.execute("exclamation", "bbb"));
       
View Full Code Here

        builder.setBolt("sum", new UpdateGlobalCount())
                .globalGrouping("partial-count");
       
        LocalCluster cluster = new LocalCluster();
       
        Config config = new Config();
        config.setDebug(true);
        config.setMaxSpoutPending(3);
       
        cluster.submitTopology("global-count-topology", config, builder.buildTopology());
       
        Thread.sleep(3000);
        cluster.shutdown();
View Full Code Here

        builder.setSpout("age", ageSpout);
        builder.setBolt("join", new SingleJoinBolt(new Fields("gender", "age")))
                .fieldsGrouping("gender", new Fields("id"))
                .fieldsGrouping("age", new Fields("id"));
       
        Config conf = new Config();
        conf.setDebug(true);
       
        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("join-example", conf, builder.createTopology());
       
        for(int i=0; i<10; i++) {
View Full Code Here

        // TODO Auto-generated method stub
        TopologyBuilder builder = new TopologyBuilder();

        builder.setSpout("signal-spout", new TestSignalSpout("test-signal-spout"));

        Config conf = new Config();
        conf.setDebug(true);

        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("test", conf, builder.createTopology());
        Utils.sleep(120000);
        cluster.killTopology("test");
View Full Code Here

    {
        // Read topology file created by petrelbuilder.
        StormTopology topology = readTopology();

        // Get topology-specific configuration from the JAR.
        Config conf = new Config();
        InputStream stream = ResourceLoader.getResourceAsStream("resources/__topology__.yaml", GenericTopology.class);
        try
        {
            Yaml yaml = new Yaml();
            Map localConf = (Map) yaml.load(new InputStreamReader(stream));
            conf.putAll(localConf);
        }
        finally
        {
            // Close stream
            stream.close();
        }

        // Read __submitter__.yaml to get submitter user and hostname
        // information. Include it in the config.
        stream = ResourceLoader.getResourceAsStream("resources/__submitter__.yaml", GenericTopology.class);
        try
        {
            Yaml yaml = new Yaml();
            Map submitterConf = (Map) yaml.load(new InputStreamReader(stream));
            conf.putAll(submitterConf);
        }
        finally
        {
            // Close stream
            stream.close();
        }
       
        if (args!=null && args.length > 0)
        {
            StormSubmitter.submitTopology(args[0], conf, topology);
        }
        else
        {
            // Force some conservative settings to try and avoid overloading a
            // local machine's CPU or memory.
            conf.setDebug(true);
            conf.setNumWorkers(1);
            conf.setMaxTaskParallelism(1);

            final LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("test topology", conf, topology);

            Runtime.getRuntime().addShutdownHook(new Thread() {
View Full Code Here

  }

  @Override
  public Map getComponentConfiguration() {
    // no particular configuration here
    return new Config();
  }
View Full Code Here

    return topology.build();
  }

  public static void main(String[] args) throws Exception {
    Config conf = new Config();

    LocalDRPC drpc = new LocalDRPC();
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("hackaton", conf, buildTopology(drpc));
  }
View Full Code Here

TOP

Related Classes of backtype.storm.Config

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.