backtype.storm.Config.setDebug()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中backtype.storm.Config.setDebug()方法的一些代码示例,展示了Config.setDebug()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.setDebug()方法的具体详情如下:
包路径:backtype.storm.Config
类名称:Config
方法名:setDebug

Config.setDebug介绍

暂无

代码示例

代码示例来源:origin: alibaba/jstorm

public void setDebug(boolean isOn) {
  setDebug(this, isOn);
}

代码示例来源:origin: alibaba/jstorm

private static Config createTopologyConfiguration() {
  Config conf = new Config();
  conf.setDebug(true);
  return conf;
}

代码示例来源:origin: alibaba/jstorm

private static Config createTopologyConfiguration() {
  Config conf = new Config();
  conf.setDebug(true);
  return conf;
}

代码示例来源:origin: alibaba/jstorm

public static void test() {
  MemoryTransactionalSpout spout = new MemoryTransactionalSpout(DATA, new Fields("word"),
      PARTITION_TAKE_PER_BATCH);
  TransactionalTopologyBuilder builder = new TransactionalTopologyBuilder("global-count", "spout", spout, 1);
  builder.setBolt("partial-count", new BatchCount(), 2).noneGrouping("spout");
  builder.setBolt("sum", new UpdateGlobalCount(), 1).globalGrouping("partial-count");
  
  conf.setDebug(true);
  conf.setMaxSpoutPending(3);
  
  String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
  String topologyName = className[className.length - 1];
  try {
    JStormHelper.runTopology(builder.buildTopology(), topologyName, conf, 60,
        new JStormHelper.CheckAckedFail(conf), isLocal);
  } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    Assert.fail("Failed");
  }
}

代码示例来源:origin: alibaba/jstorm

public static void test() {
  TopologyBuilder builder = new TopologyBuilder();
  
  builder.setSpout("spout", new RandomSentenceSpout(), 5);
  
  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);
  
  String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
  String topologyName = className[className.length - 1];
  
  try {
    JStormHelper.runTopology(builder.createTopology(), topologyName, conf, 60,
        new JStormHelper.CheckAckedFail(conf), isLocal);
  } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    Assert.fail("Failed");
  }
}

代码示例来源:origin: alibaba/jstorm

public static void test() {
  
  String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
  String topologyName = className[className.length - 1];
  
  try {
    TopologyBuilder builder = new TopologyBuilder();
    BaseWindowedBolt bolt = new SlidingWindowSumBolt()
        .withWindow(new Duration(5, TimeUnit.SECONDS), new Duration(3, TimeUnit.SECONDS))
        .withTimestampField("ts").withLag(new Duration(5, TimeUnit.SECONDS));
    builder.setSpout("integer", new RandomIntegerSpout(), 1);
    builder.setBolt("slidingsum", bolt, 1).shuffleGrouping("integer");
    builder.setBolt("printer", new PrinterBolt(), 1).shuffleGrouping("slidingsum");
    
    conf.setDebug(true);
    
    JStormHelper.runTopology(builder.createTopology(), topologyName, conf, 60,
        new JStormHelper.CheckAckedFail(conf), isLocal);
  } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    Assert.fail("Failed");
  }
}

代码示例来源:origin: alibaba/jstorm

conf.setDebug(true);

代码示例来源:origin: alibaba/jstorm

public static void test() {
  
  String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
  String topologyName = className[className.length - 1];
  
  try {
    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");
    
    conf.setDebug(true);
    
    JStormHelper.runTopology(builder.createTopology(), topologyName, conf, 60,
        new JStormHelper.CheckAckedFail(conf), isLocal);
  } catch (Exception e) {
    // TODO Auto-generated catch block
    e.fillInStackTrace();
    Assert.fail("Failed to submit topology");
  }
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

public void setDebug(boolean isOn) {
  setDebug(this, isOn);
}

代码示例来源:origin: com.n3twork.storm/storm-core

public void setDebug(boolean isOn) {
  setDebug(this, isOn);
}

代码示例来源:origin: com.twitter.heron/heron-storm

public void setDebug(boolean isOn) {
 setDebug(this, isOn);
}

代码示例来源:origin: pranab/chombo

/**
 * @param configFilePath
 * @return
 * @throws IOException
 */
public static Config buildStormConfig(String configFilePath) throws IOException {
  FileInputStream fis = new FileInputStream(configFilePath);
  Properties configProps = new Properties();
  configProps.load(fis);
  //initialize config
  Config conf = new Config();
  conf.setDebug(true);
  for (Object key : configProps.keySet()){
    String keySt = key.toString();
    String val = configProps.getProperty(keySt);
    conf.put(keySt, val);
  }
  
  return conf;
}

代码示例来源:origin: com.boozallen.cognition/storm-core

void submitLocal(ILocalCluster cluster) throws AlreadyAliveException, InvalidTopologyException {
 stormConfig.setDebug(true);
 cluster.submitTopology(topologyName, stormConfig, builder.createTopology());
}

代码示例来源:origin: menacher/nerdronix

public static void main(String[] args) throws InterruptedException {
  Config config = new Config();
  config.setDebug(true);
  config.setNumWorkers(2);
  LocalCluster cluster = new LocalCluster();
  cluster.submitTopology("test", config, createTopology());
  LATCH.await();
  System.out.println("Processing complete");
  cluster.killTopology("test");
  cluster.shutdown();
}

代码示例来源:origin: appleappleapple/BigDataLearning

public static void main(String[] args) throws AlreadyAliveException, InvalidTopologyException {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("word-reader", new WordReaderSpout());
    builder.setBolt("word-spilter", new WordSpliterBolt()).shuffleGrouping("word-reader");
    builder.setBolt("word-counter", new WordCounterBolt()).shuffleGrouping("word-spilter");

    Config conf = new Config();

    conf.setDebug(true);

    if (args.length >0 && "cluster".equals(args[0])) {
      StormSubmitter.submitTopology("Cluster-Storm-Demo", conf, builder.createTopology());
    } else {
      LocalCluster cluster = new LocalCluster();
      cluster.submitTopology("Local-Storm-Demo", conf, builder.createTopology());
    }
  }
}

代码示例来源:origin: fjfd/microscope

public static void main(String[] args) throws InterruptedException {
  TopologyBuilder builder = new TopologyBuilder();
  builder.setSpout("word-reader", new WordReader());
  builder.setBolt("word-normalizer", new WordNormalizer())
      .shuffleGrouping("word-reader");
  builder.setBolt("word-counter", new WordCounter(), 2)
      .fieldsGrouping("word-normalizer", new Fields("word"));
  //Configuration
  Config conf = new Config();
  conf.put("wordsFile", "E:\\Workspace\\microscope\\microscope-storm\\src\\main\\resources\\words.txt");
  conf.setDebug(false);
  //Topology run
  conf.put(Config.TOPOLOGY_MAX_SPOUT_PENDING, 1);
  LocalCluster cluster = new LocalCluster();
  cluster.submitTopology("Getting-Started-Toplogie", conf, builder.createTopology());
  Thread.sleep(1000);
  cluster.shutdown();
}

代码示例来源:origin: storm-book/examples-ch02-getting_started

public static void main(String[] args) throws InterruptedException {
         //Topology definition
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("word-reader",new WordReader());
    builder.setBolt("word-normalizer", new WordNormalizer())
      .shuffleGrouping("word-reader");
    builder.setBolt("word-counter", new WordCounter(),1)
      .fieldsGrouping("word-normalizer", new Fields("word"));
    
    //Configuration
    Config conf = new Config();
    conf.put("wordsFile", args[0]);
    conf.setDebug(false);
    //Topology run
    conf.put(Config.TOPOLOGY_MAX_SPOUT_PENDING, 1);
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("Getting-Started-Toplogie", conf, builder.createTopology());
    Thread.sleep(1000);
    cluster.shutdown();
  }
}

代码示例来源:origin: openimaj/openimaj

public static void main(String[] args) {
    final Config conf = new Config();
    conf.setDebug(false);
    conf.setNumWorkers(2);
    conf.setMaxSpoutPending(1);
    conf.setFallBackOnJavaSerialization(false);
    conf.setSkipMissingKryoRegistrations(false);
    final LocalCluster cluster = new LocalCluster();
    final TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("randomSpout1", new RandomFieldSpout(2, 0, 0, 1)); // (nfields,seed,min,max)
    builder.setSpout("randomSpout2", new RandomFieldSpout(2, 10, 0, 1)); // (nfields,seed,min,max)
    JoinBolt.connectNewBolt(builder);
    final StormTopology topology = builder.createTopology();
    cluster.submitTopology("playTopology", conf, topology);
    Utils.sleep(10000);
    cluster.killTopology("playTopology");
    cluster.shutdown();

  }
}

代码示例来源:origin: org.openimaj.storm/core-storm

public static void main(String[] args) {
    final Config conf = new Config();
    conf.setDebug(false);
    conf.setNumWorkers(2);
    conf.setMaxSpoutPending(1);
    conf.setFallBackOnJavaSerialization(false);
    conf.setSkipMissingKryoRegistrations(false);
    final LocalCluster cluster = new LocalCluster();
    final TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("randomSpout1", new RandomFieldSpout(2, 0, 0, 1)); // (nfields,seed,min,max)
    builder.setSpout("randomSpout2", new RandomFieldSpout(2, 10, 0, 1)); // (nfields,seed,min,max)
    JoinBolt.connectNewBolt(builder);
    final StormTopology topology = builder.createTopology();
    cluster.submitTopology("playTopology", conf, topology);
    Utils.sleep(10000);
    cluster.killTopology("playTopology");
    cluster.shutdown();

  }
}

代码示例来源:origin: calrissian/flowmix

public void run() {
 StormTopology topology = new FlowmixBuilder()
   .setFlowLoader(new SimpleFlowLoaderSpout(provider.getFlows(), 60000))
   .setEventsLoader(new MockEventGeneratorSpout(getMockEvents(), 10))
   .setOutputBolt(new PrinterBolt())
   .setParallelismHint(6)
  .create()
 .createTopology();
 Config conf = new Config();
 conf.setNumWorkers(20);
 conf.setMaxSpoutPending(5000);
 conf.setDebug(false);
 conf.registerSerialization(BaseEvent.class, EventSerializer.class);
 conf.setSkipMissingKryoRegistrations(false);
 LocalCluster cluster = new LocalCluster();
 cluster.submitTopology("example-topology", conf, topology);
}

相关文章