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


Java Config.putAll方法代码示例

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


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

示例1: run

import org.apache.storm.Config; //导入方法依赖的package包/类
private static void run(String name)
        throws ClassNotFoundException, IllegalAccessException,
        InstantiationException, AlreadyAliveException, InvalidTopologyException {
  LOG.info("running benchmark " + name);
  IBenchmark benchmark =  (IBenchmark) Runner.getApplicationFromName(PACKAGE + "." + name);
  Config config = new Config();
  config.putAll(Utils.readStormConfig());
  config.setDebug(true);
  StormTopology topology = benchmark.getTopology(config);
  LocalCluster localCluster = new LocalCluster();
  localCluster.submitTopology(name, config, topology);
  final int runtime = BenchmarkUtils.getInt(config, MetricsCollectorConfig.METRICS_TOTAL_TIME,
          MetricsCollectorConfig.DEFAULT_TOTAL_TIME);
  IMetricsCollector collector = benchmark.getMetricsCollector(config, topology);
  collector.run();
  try {
    Thread.sleep(runtime);
  } catch (InterruptedException e) {
    LOG.error("benchmark interrupted", e);
  }
  localCluster.shutdown();
}
 
开发者ID:MBtech,项目名称:stormbenchmark,代码行数:23,代码来源:LocalRunner.java

示例2: getTopology

import org.apache.storm.Config; //导入方法依赖的package包/类
@Override
public StormTopology getTopology(Config config) {
  config.putAll(getKafkaConfig(config));

  final int spoutNum = BenchmarkUtils.getInt(config , SPOUT_NUM, DEFAULT_SPOUT_NUM);
  final int boltNum = BenchmarkUtils.getInt(config, BOLT_NUM, DEFAULT_BOLT_NUM);

  TopologyBuilder builder = new TopologyBuilder();
  builder.setSpout(SPOUT_ID, spout, spoutNum);
  builder.setBolt(BOLT_ID, bolt, boltNum).localOrShuffleGrouping(SPOUT_ID);
  return builder.createTopology();
}
 
开发者ID:MBtech,项目名称:stormbenchmark,代码行数:13,代码来源:KafkaProducer.java

示例3: submitTopology

import org.apache.storm.Config; //导入方法依赖的package包/类
public static Config submitTopology(ILocalCluster stormCluster, String topologyName,
                                    StormTopology stormTopology) throws Exception {
    Config stormConf = new Config();
    stormConf.putAll(Utils.readDefaultConfig());
    stormConf.put("storm.cluster.mode", "local");
    stormConf.setDebug(true);
    stormConf.setMaxTaskParallelism(3);
    stormConf.put(Config.STORM_TOPOLOGY_SUBMISSION_NOTIFIER_PLUGIN,
            org.apache.atlas.storm.hook.StormAtlasHook.class.getName());

    stormCluster.submitTopology(topologyName, stormConf, stormTopology);

    Thread.sleep(10000);
    return stormConf;
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:16,代码来源:StormTestUtil.java

示例4: getConfig

import org.apache.storm.Config; //导入方法依赖的package包/类
public static Optional<Config> getConfig(CommandLine cli, Config config) {
  if(EXTRA_OPTIONS.has(cli)) {
    Map<String, Object> extraOptions = readJSONMapFromFile(new File(EXTRA_OPTIONS.get(cli)));
    config.putAll(extraOptions);
  }
  for(ParserOptions option : ParserOptions.values()) {
    config = option.configHandler.apply(new Arg(config, option.get(cli)));
  }
  return config.isEmpty()?Optional.empty():Optional.of(config);
}
 
开发者ID:apache,项目名称:metron,代码行数:11,代码来源:ParserTopologyCLI.java

示例5: prepare

import org.apache.storm.Config; //导入方法依赖的package包/类
public static void prepare() {
    Config conf = new Config();
    conf.putAll(Utils.readStormConfig());
    store = Utils.getClientBlobStore(conf);
}
 
开发者ID:ziyunhx,项目名称:storm-net-adapter,代码行数:6,代码来源:BlobStoreAPIWordCountTopology.java


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