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

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

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

Config.containsKey介绍

暂无

代码示例

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

private List getRegisteredSerializations() {
    if(!containsKey(Config.TOPOLOGY_KRYO_REGISTER)) {
      put(Config.TOPOLOGY_KRYO_REGISTER, new ArrayList());
    }
    return (List) get(Config.TOPOLOGY_KRYO_REGISTER);
  }
}

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

public static void test(Config conf) throws Exception {
  int spout_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_SPOUT_PARALLELISM_HINT), 1);
  int split_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_SPLIT_PARALLELISM_HINT), 1);
  int count_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_COUNT_PARALLELISM_HINT), 1);
  TopologyBuilder builder = new TopologyBuilder();
  builder.setSpout("spout", new FastRandomSentenceSpout(), spout_Parallelism_hint);
  builder.setBolt("split", new SplitSentence(), split_Parallelism_hint).shuffleGrouping("spout");
  long windowSize = JStormUtils.parseLong(conf.get("window.size.sec"), 10);
  long stateWindowSize = JStormUtils.parseLong(conf.get("state.window.size.sec"), 60);
  builder.setBolt("count", new WordCount()
          .timeWindow(Time.seconds(windowSize))
          .withStateSize(Time.seconds(stateWindowSize)),
      count_Parallelism_hint).fieldsGrouping("split", new Fields("word"));
  String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
  String topologyName = className[className.length - 1];
  boolean isLocal = true;
  if (conf.containsKey("storm.cluster.mode")) {
    isLocal = StormConfig.local_mode(conf);
  }
  // RUN_LONG_TIME = true
  JStormHelper.runTopology(builder.createTopology(), topologyName, conf, 60,
      new JStormHelper.CheckAckedFail(conf), isLocal);
}

代码示例来源:origin: org.jwall/streams-storm

if (!config.containsKey(opt)) {
  log.error("Required parameter '{}' not set!", opt);
  err++;

相关文章