当前位置: 首页>>代码示例>>Java>>正文


Java StormSubmitter.submitTopologyWithProgressBar方法代码示例

本文整理汇总了Java中org.apache.storm.StormSubmitter.submitTopologyWithProgressBar方法的典型用法代码示例。如果您正苦于以下问题:Java StormSubmitter.submitTopologyWithProgressBar方法的具体用法?Java StormSubmitter.submitTopologyWithProgressBar怎么用?Java StormSubmitter.submitTopologyWithProgressBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.storm.StormSubmitter的用法示例。


在下文中一共展示了StormSubmitter.submitTopologyWithProgressBar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("integer", new RandomIntegerSpout(), 1);
    builder.setBolt("slidingsum", new SlidingWindowSumBolt().withWindow(new Count(30), new Count(10)), 1)
            .shuffleGrouping("integer");
    builder.setBolt("tumblingavg", new TumblingWindowAvgBolt().withTumblingWindow(new Count(3)), 1)
            .shuffleGrouping("slidingsum");
    builder.setBolt("printer", new PrinterBolt(), 1).shuffleGrouping("tumblingavg");
    Config conf = new Config();
    conf.setDebug(true);
    if (args != null && args.length > 0) {
        conf.setNumWorkers(1);
        StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
    } else {
        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("test", conf, builder.createTopology());
        Utils.sleep(40000);
        cluster.killTopology("test");
        cluster.shutdown();
    }
}
 
开发者ID:bigdataFlySQL,项目名称:SQLonStorm,代码行数:22,代码来源:SlidingWindowTopology.java

示例2: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    TopologyBuilder builder = new TopologyBuilder();

    builder.setSpout("word", new WordSpout(), 1);
    builder.setBolt("exclaim", new ExclamationBolt(), 1).shuffleGrouping("word");   // Tuple流向:word 》 exclaim
    builder.setBolt("print", new PrintBolt(), 1).shuffleGrouping("exclaim");        // exclaim 》 print

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

    if (args != null && args.length > 0) {
        conf.setNumWorkers(3);

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

        LocalCluster cluster = new LocalCluster();      // storm依赖,<scope>provided</scope>--> 本地开发是注释掉 -->
        cluster.submitTopology("test3", conf, builder.createTopology());
        Utils.sleep(60 * 1000);
        cluster.killTopology("test3");
        cluster.shutdown();
    }
}
 
开发者ID:xuxueli,项目名称:xxl-incubator,代码行数:24,代码来源:ExclamationTopology.java

示例3: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    StormTopology topology = buildTopology();

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

    if (args != null && args.length > 0) {
        conf.setNumWorkers(3);
        StormSubmitter.submitTopologyWithProgressBar(args[0], conf, topology);
    } else {
        LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("wordcount", conf, topology);
        try {
            System.out.println("PRESS ENTER TO STOP");
            new BufferedReader(new InputStreamReader(System.in)).readLine();
            cluster.killTopology("wordcount");
            cluster.shutdown();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:zirpins,项目名称:bdelab,代码行数:23,代码来源:WordcountTopology.java

示例4: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
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 < 100; i++) {
      System.out.println("DRPC RESULT: " + drpc.execute("words", "cat the dog jumped"));
      Thread.sleep(1000);
    }
  }
  else {
    conf.setNumWorkers(3);
    StormSubmitter.submitTopologyWithProgressBar(args[0], conf, buildTopology(null));
  }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:18,代码来源:TridentWordCount.java

示例5: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
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 < 100; i++) {
            System.out.println("DRPC RESULT: " + drpc.execute("words", "CAT THE DOG JUMPED"));
            Thread.sleep(1000);
        }
    } else {
        conf.setNumWorkers(3);
        StormSubmitter.submitTopologyWithProgressBar(args[0], conf, buildTopology(null));
    }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:17,代码来源:TridentMapExample.java

示例6: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Config conf = new Config();
    WindowsStoreFactory mapState = new InMemoryWindowsStoreFactory();

    if (args.length == 0) {
        List<? extends WindowConfig> list = Arrays.asList(
                SlidingCountWindow.of(1000, 100)
                ,TumblingCountWindow.of(1000)
                ,SlidingDurationWindow.of(new BaseWindowedBolt.Duration(6, TimeUnit.SECONDS), new BaseWindowedBolt.Duration(3, TimeUnit.SECONDS))
                ,TumblingDurationWindow.of(new BaseWindowedBolt.Duration(3, TimeUnit.SECONDS))
        );

        for (WindowConfig windowConfig : list) {
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("wordCounter", conf, buildTopology(mapState, windowConfig));
            Utils.sleep(60 * 1000);
            cluster.shutdown();
        }
        System.exit(0);
    } else {
        conf.setNumWorkers(3);
        StormSubmitter.submitTopologyWithProgressBar(args[0], conf, buildTopology(mapState, SlidingCountWindow.of(1000, 100)));
    }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:25,代码来源:TridentWindowingInmemoryStoreTopology.java

示例7: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Config conf = new Config();
    conf.setMaxSpoutPending(20);
    conf.put(Config.TOPOLOGY_TRIDENT_WINDOWING_INMEMORY_CACHE_LIMIT, 100);

    // window-state table should already be created with cf:tuples column
    HBaseWindowsStoreFactory windowStoreFactory = new HBaseWindowsStoreFactory(new HashMap<String, Object>(), "window-state", "cf".getBytes("UTF-8"), "tuples".getBytes("UTF-8"));

    if (args.length == 0) {
        LocalCluster cluster = new LocalCluster();
        String topologyName = "wordCounterWithWindowing";
        cluster.submitTopology(topologyName, conf, buildTopology(windowStoreFactory));
        Utils.sleep(120 * 1000);
        cluster.killTopology(topologyName);
        cluster.shutdown();
        System.exit(0);
    } else {
        conf.setNumWorkers(3);
        StormSubmitter.submitTopologyWithProgressBar(args[0], conf, buildTopology(windowStoreFactory));
    }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:22,代码来源:TridentHBaseWindowingStoreTopology.java

示例8: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

        StormTopology topology = buildVehiclesTopology();
        Config conf = new Config();
        conf.setMaxSpoutPending(20);
        if (args.length == 0) {
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("vehicles-topology", conf, topology);
            Utils.sleep(60 * 1000);
            cluster.shutdown();
            System.exit(0);
        } else {
            conf.setNumWorkers(3);
            StormSubmitter.submitTopologyWithProgressBar("vehicles-topology", conf, topology);
        }
    }
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:17,代码来源:TridentMinMaxOfVehiclesTopology.java

示例9: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

        StormTopology topology = buildDevicesTopology();
        Config conf = new Config();
        conf.setMaxSpoutPending(20);
        if (args.length == 0) {
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology("devices-topology", conf, topology);
            Utils.sleep(60 * 1000);
            cluster.shutdown();
            System.exit(0);
        } else {
            conf.setNumWorkers(3);
            StormSubmitter.submitTopologyWithProgressBar("devices-topology", conf, topology);
        }
    }
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:17,代码来源:TridentMinMaxOfDevicesTopology.java

示例10: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("spout", new RandomIntegerSpout());
    builder.setBolt("partialsum", new StatefulSumBolt("partial"), 1).shuffleGrouping("spout");
    builder.setBolt("printer", new PrinterBolt(), 2).shuffleGrouping("partialsum");
    builder.setBolt("total", new StatefulSumBolt("total"), 1).shuffleGrouping("printer");
    Config conf = new Config();
    conf.setDebug(false);

    if (args != null && args.length > 0) {
        conf.setNumWorkers(1);
        StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
    } else {
        LocalCluster cluster = new LocalCluster();
        StormTopology topology = builder.createTopology();
        cluster.submitTopology("test", conf, topology);
        Utils.sleep(40000);
        cluster.killTopology("test");
        cluster.shutdown();
    }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:22,代码来源:StatefulTopology.java

示例11: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  LinearDRPCTopologyBuilder builder = construct();


  Config conf = new Config();

  if (args == null || args.length == 0) {
    conf.setMaxTaskParallelism(3);
    LocalDRPC drpc = new LocalDRPC();
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("reach-drpc", conf, builder.createLocalTopology(drpc));

    String[] urlsToTry = new String[]{ "foo.com/blog/1", "engineering.twitter.com/blog/5", "notaurl.com" };
    for (String url : urlsToTry) {
      System.out.println("Reach of " + url + ": " + drpc.execute("reach", url));
    }

    cluster.shutdown();
    drpc.shutdown();
  }
  else {
    conf.setNumWorkers(6);
    StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createRemoteTopology());
  }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:26,代码来源:ReachTopology.java

示例12: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  TopologyBuilder builder = new TopologyBuilder();

  builder.setSpout("word", new TestWordSpout(), 10);
  builder.setBolt("exclaim1", new ExclamationLoggingBolt(), 3).shuffleGrouping("word");
  builder.setBolt("exclaim2", new ExclamationLoggingBolt(), 2).shuffleGrouping("exclaim1");

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

  if (args != null && args.length > 0) {
    conf.setNumWorkers(2);
    StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
  } else {
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("test", conf, builder.createTopology());
    Utils.sleep(10000);
    cluster.killTopology("test");
    cluster.shutdown();
  }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:22,代码来源:MultipleLoggerTopology.java

示例13: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  TopologyBuilder builder = new TopologyBuilder();

  builder.setSpout("word", new TestWordSpout(), 10);
  builder.setBolt("exclaim1", new ExclamationBolt(), 3).shuffleGrouping("word");
  builder.setBolt("exclaim2", new ExclamationBolt(), 2).shuffleGrouping("exclaim1");

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

  if (args != null && args.length > 0) {
    conf.setNumWorkers(3);

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

    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("test", conf, builder.createTopology());
    Utils.sleep(10000);
    cluster.killTopology("test");
    cluster.shutdown();
  }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:25,代码来源:ExclamationTopology.java

示例14: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder("exclamation");
  builder.addBolt(new ExclaimBolt(), 3);

  Config conf = new Config();

  if (args == null || args.length == 0) {
    LocalDRPC drpc = new LocalDRPC();
    LocalCluster cluster = new LocalCluster();

    cluster.submitTopology("drpc-demo", conf, builder.createLocalTopology(drpc));

    for (String word : new String[]{ "hello", "goodbye" }) {
      System.out.println("Result for \"" + word + "\": " + drpc.execute("exclamation", word));
    }

    Thread.sleep(10000);
    drpc.shutdown();
    cluster.shutdown();
  }
  else {
    conf.setNumWorkers(3);
    StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createRemoteTopology());
  }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:26,代码来源:BasicDRPCTopology.java

示例15: main

import org.apache.storm.StormSubmitter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("spout", new RandomIntegerSpout());
    builder.setBolt("sumbolt", new WindowSumBolt().withWindow(new Count(5), new Count(3))
            .withMessageIdField("msgid"), 1).shuffleGrouping("spout");
    builder.setBolt("printer", new PrinterBolt(), 1).shuffleGrouping("sumbolt");
    Config conf = new Config();
    conf.setDebug(false);
    //conf.put(Config.TOPOLOGY_STATE_PROVIDER, "org.apache.storm.redis.state.RedisKeyValueStateProvider");
    if (args != null && args.length > 0) {
        conf.setNumWorkers(1);
        StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
    } else {
        LocalCluster cluster = new LocalCluster();
        StormTopology topology = builder.createTopology();
        cluster.submitTopology("test", conf, topology);
        Utils.sleep(40000);
        cluster.killTopology("test");
        cluster.shutdown();
    }
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:22,代码来源:StatefulWindowingTopology.java


注:本文中的org.apache.storm.StormSubmitter.submitTopologyWithProgressBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。