Package backtype.storm

Examples of backtype.storm.LocalCluster


        builder.setSpout(WORD_SPOUT, spout, 1);
        builder.setBolt(LOOKUP_BOLT, hBaseLookupBolt, 1).shuffleGrouping(WORD_SPOUT);
        builder.setBolt(TOTAL_COUNT_BOLT, totalBolt, 1).fieldsGrouping(LOOKUP_BOLT, new Fields("columnName"));

        if (args.length == 1) {
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("test", config, builder.createTopology());
            Thread.sleep(30000);
            cluster.killTopology("test");
            cluster.shutdown();
            System.exit(0);
        } else if (args.length == 2) {
            StormSubmitter.submitTopology(args[1], config, builder.createTopology());
        } else{
            System.out.println("Usage: LookupWordCount <hbase.rootdir>");
View Full Code Here


        .shuffleGrouping("spout");

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

    LocalCluster cluster = new LocalCluster();
    cluster
        .submitTopology("hbase-example", stormConf, builder.createTopology());

    Utils.sleep(10000);
    cluster.shutdown();
  }
View Full Code Here

    ttConfig.addColumn("daily", "date");

    builder.setBolt("hbase-counters", new HBaseCountersBatchBolt(ttConfig), 2)
        .fieldsGrouping("spout", new Fields("shortid"));

    LocalCluster cluster = new LocalCluster();

    Config stormConfig = new Config();
    stormConfig.setDebug(true);
    stormConfig.setMaxSpoutPending(3);

    cluster.submitTopology("hbase-example", stormConfig,
        builder.buildTopology());

    Thread.sleep(10000);
    cluster.shutdown();
  }
View Full Code Here

            new Fields("cf", "cq")).project(new Fields("shortid", "cf", "cq"))
        .groupBy(new Fields("shortid", "cf", "cq"))
        .persistentAggregate(state, new Count(), new Fields("count"));

    Config conf = new Config();
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("hbase-trident-aggregate", conf, topology.build());

    Utils.sleep(5000);
    cluster.shutdown();
  }
View Full Code Here

    builder.setBolt("hbase", new HBaseBolt(config), 1).shuffleGrouping("spout");

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

    LocalCluster cluster = new LocalCluster();
    cluster
        .submitTopology("hbase-example", stormConf, builder.createTopology());

    Utils.sleep(10000);
    cluster.shutdown();
  }
View Full Code Here

    topology.newStream("shorturls", spout).partitionPersist(
        new HBaseValueFactory(updateConfig),
        new Fields("shortid", "url", "user", "date"), new HBaseValueUpdater());

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

    cluster.submitTopology("hbase-trident-updater", conf, topology.build());
    Utils.sleep(10000);
    cluster.shutdown();
  }
View Full Code Here

    public static void main(String[] args) throws Exception {
        Config conf = new Config();
        conf.setMaxSpoutPending(20);
        if(args.length==0) {
            LocalDRPC drpc = new LocalDRPC();
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("wordCounter", conf, buildTopology(drpc));
            for(int i=0; i<2; i++) {
                LOG.info("DRPC RESULT: " + drpc.execute("words", "dog the dog cat"));
                Thread.sleep(1000);
            }
            System.exit(0);
View Full Code Here

    public static void main(String[] args) throws Exception {
        Config conf = new Config();
        conf.setMaxSpoutPending(20);
        if(args.length==0) {
            LocalDRPC drpc = new LocalDRPC();
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("wordCounter", conf, buildTopology(drpc));
            for(int i=0; i<2; i++) {
                _spout.feed(new ArrayList(Arrays.asList("dog the the cat")));
                Thread.sleep(10000);
                LOG.info("DRPC RESULT: " + drpc.execute("words", "dog the dog cat"));
            }
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);
       
        LOG.info("REACH: " + drpc.execute("reach", "aaa"));
        LOG.info("REACH: " + drpc.execute("reach", "foo.com/blog/1"));
        LOG.info("REACH: " + drpc.execute("reach", "engineering.twitter.com/blog/5"));
       
       
        cluster.shutdown();
        drpc.shutdown();
    }
View Full Code Here

      // number of ackers has to be specified in Local Mode
      final int numAckers = SystemParameters.getInt(conf, "DIP_NUM_ACKERS");
      conf.setNumAckers(numAckers);

      conf.setFallBackOnJavaSerialization(false);
      final LocalCluster cluster = new LocalCluster();
      startTime = System.currentTimeMillis();
      cluster.submitTopology(topologyName, 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.