本文整理了Java中backtype.storm.Config.putAll()
方法的一些代码示例,展示了Config.putAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.putAll()
方法的具体详情如下:
包路径:backtype.storm.Config
类名称:Config
方法名:putAll
暂无
代码示例来源:origin: alibaba/jstorm
public Validator(Config conf) {
this.conf.putAll(Utils.readStormConfig());
this.conf.putAll(conf);
}
代码示例来源:origin: alibaba/jstorm
public Validator(Config conf) {
this.conf.putAll(Utils.readStormConfig());
this.conf.putAll(conf);
}
代码示例来源:origin: alibaba/jstorm
@Override
public void process(Config conf, CommandLine commandLine) throws ParseException {
for (String s : commandLine.getOptionValues("D")) {
String[] keyval = s.split("=", 2);
if (keyval.length != 2)
throw new ParseException("Invalid option value `" + s + "'");
conf.putAll((Map) yaml.load(keyval[0] + ": " + keyval[1]));
}
}
}
代码示例来源:origin: alibaba/jstorm
public static Config getConfig(String[] args) {
Config ret = new Config();
if (args == null || args.length == 0) {
return ret;
}
if (StringUtils.isBlank(args[0])) {
return ret;
}
Map conf = JStormHelper.LoadConf(args[0]);
ret.putAll(conf);
return ret;
}
代码示例来源:origin: alibaba/jstorm
@Override
public void process(Config conf, CommandLine commandLine) throws ParseException {
try {
for (String f : commandLine.getOptionValues("conf")) {
Map m = loadConf(f);
if (m == null)
throw new ParseException("Empty configuration file " + f);
conf.putAll(m);
}
} catch (IOException e) {
throw new ParseException(e.getMessage());
}
}
}
代码示例来源:origin: alibaba/jstorm
Map yamlConf = LoadConf.LoadYaml(args[0]);
if (yamlConf != null) {
conf.putAll(yamlConf);
代码示例来源:origin: ptgoetz/flux
/**
* Given a topology definition, return a populated `backtype.storm.Config` instance.
*
* @param topologyDef
* @return
*/
public static Config buildConfig(TopologyDef topologyDef) {
// merge contents of `config` into topology config
Config conf = new Config();
conf.putAll(topologyDef.getConfig());
return conf;
}
代码示例来源:origin: com.alibaba.jstorm/jstorm-core
@Override
public void process(Config conf, CommandLine commandLine) throws ParseException {
for (String s : commandLine.getOptionValues("D")) {
String[] keyval = s.split("=", 2);
if (keyval.length != 2)
throw new ParseException("Invalid option value `" + s + "'");
conf.putAll((Map) yaml.load(keyval[0] + ": " + keyval[1]));
}
}
}
代码示例来源:origin: com.alibaba.jstorm/jstorm-core
@Override
public void process(Config conf, CommandLine commandLine) throws ParseException {
try {
for (String f : commandLine.getOptionValues("conf")) {
Map m = loadConf(f);
if (m == null)
throw new ParseException("Empty configuration file " + f);
conf.putAll(m);
}
} catch (IOException e) {
throw new ParseException(e.getMessage());
}
}
}
代码示例来源:origin: ptgoetz/flux
private static StormTopology buildExternalTopology(ObjectDef def, ExecutionContext context)
throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException,
InvocationTargetException {
Object topologySource = buildObject(def, context);
String methodName = context.getTopologyDef().getTopologySource().getMethodName();
Method getTopology = findGetTopologyMethod(topologySource, methodName);
if(getTopology.getParameterTypes()[0].equals(Config.class)){
Config config = new Config();
config.putAll(context.getTopologyDef().getConfig());
return (StormTopology) getTopology.invoke(topologySource, config);
} else {
return (StormTopology) getTopology.invoke(topologySource, context.getTopologyDef().getConfig());
}
}
内容来源于网络,如有侵权,请联系作者删除!