本文整理了Java中org.apache.samza.util.Util.rewriteConfig()
方法的一些代码示例,展示了Util.rewriteConfig()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.rewriteConfig()
方法的具体详情如下:
包路径:org.apache.samza.util.Util
类名称:Util
方法名:rewriteConfig
暂无
代码示例来源:origin: apache/samza
static Config mergeConfig(Map<String, String> originalConfig, Map<String, String> generatedConfig) {
Map<String, String> mergedConfig = new HashMap<>(generatedConfig);
originalConfig.forEach((k, v) -> {
if (generatedConfig.containsKey(k) && !Objects.equals(generatedConfig.get(k), v)) {
LOG.info("Replacing generated config for key: {} value: {} with original config value: {}", k, generatedConfig.get(k), v);
}
mergedConfig.put(k, v);
});
return Util.rewriteConfig(new MapConfig(mergedConfig));
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
static Config mergeConfig(Map<String, String> originalConfig, Map<String, String> generatedConfig) {
Map<String, String> mergedConfig = new HashMap<>(generatedConfig);
originalConfig.forEach((k, v) -> {
if (generatedConfig.containsKey(k) && !Objects.equals(generatedConfig.get(k), v)) {
LOG.info("Replacing generated config for key: {} value: {} with original config value: {}", k, generatedConfig.get(k), v);
}
mergedConfig.put(k, v);
});
return Util.rewriteConfig(new MapConfig(mergedConfig));
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
static Config mergeConfig(Map<String, String> originalConfig, Map<String, String> generatedConfig) {
Map<String, String> mergedConfig = new HashMap<>(generatedConfig);
originalConfig.forEach((k, v) -> {
if (generatedConfig.containsKey(k) && !Objects.equals(generatedConfig.get(k), v)) {
LOG.info("Replacing generated config for key: {} value: {} with original config value: {}", k, generatedConfig.get(k), v);
}
mergedConfig.put(k, v);
});
return Util.rewriteConfig(new MapConfig(mergedConfig));
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
static Config mergeConfig(Map<String, String> originalConfig, Map<String, String> generatedConfig) {
Map<String, String> mergedConfig = new HashMap<>(generatedConfig);
originalConfig.forEach((k, v) -> {
if (generatedConfig.containsKey(k) && !Objects.equals(generatedConfig.get(k), v)) {
LOG.info("Replacing generated config for key: {} value: {} with original config value: {}", k, generatedConfig.get(k), v);
}
mergedConfig.put(k, v);
});
return Util.rewriteConfig(new MapConfig(mergedConfig));
}
代码示例来源:origin: org.apache.samza/samza-core
static Config mergeConfig(Map<String, String> originalConfig, Map<String, String> generatedConfig) {
Map<String, String> mergedConfig = new HashMap<>(generatedConfig);
originalConfig.forEach((k, v) -> {
if (generatedConfig.containsKey(k) && !Objects.equals(generatedConfig.get(k), v)) {
LOG.info("Replacing generated config for key: {} value: {} with original config value: {}", k, generatedConfig.get(k), v);
}
mergedConfig.put(k, v);
});
return Util.rewriteConfig(new MapConfig(mergedConfig));
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
public static void main(String[] args) throws Exception {
ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerCommandLine();
OptionSet options = cmdLine.parser().parse(args);
Config orgConfig = cmdLine.loadConfig(options);
Config config = Util.rewriteConfig(orgConfig);
ApplicationRunnerOperation op = cmdLine.getOperation(options);
ApplicationRunner appRunner =
ApplicationRunners.getApplicationRunner(ApplicationUtil.fromConfig(config), config);
switch (op) {
case RUN:
appRunner.run();
break;
case KILL:
appRunner.kill();
break;
case STATUS:
System.out.println(appRunner.status());
break;
default:
throw new IllegalArgumentException("Unrecognized operation: " + op);
}
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
public static void main(String[] args) throws Exception {
ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerCommandLine();
OptionSet options = cmdLine.parser().parse(args);
Config orgConfig = cmdLine.loadConfig(options);
Config config = Util.rewriteConfig(orgConfig);
ApplicationRunnerOperation op = cmdLine.getOperation(options);
ApplicationRunner appRunner =
ApplicationRunners.getApplicationRunner(ApplicationUtil.fromConfig(config), config);
switch (op) {
case RUN:
appRunner.run();
break;
case KILL:
appRunner.kill();
break;
case STATUS:
System.out.println(appRunner.status());
break;
default:
throw new IllegalArgumentException("Unrecognized operation: " + op);
}
}
}
代码示例来源:origin: apache/samza
public static void main(String[] args) throws Exception {
ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerCommandLine();
OptionSet options = cmdLine.parser().parse(args);
Config orgConfig = cmdLine.loadConfig(options);
Config config = Util.rewriteConfig(orgConfig);
ApplicationRunnerOperation op = cmdLine.getOperation(options);
ApplicationRunner appRunner =
ApplicationRunners.getApplicationRunner(ApplicationUtil.fromConfig(config), config);
switch (op) {
case RUN:
appRunner.run(null);
break;
case KILL:
appRunner.kill();
break;
case STATUS:
System.out.println(appRunner.status());
break;
default:
throw new IllegalArgumentException("Unrecognized operation: " + op);
}
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
public static void main(String[] args) throws Exception {
ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerCommandLine();
OptionSet options = cmdLine.parser().parse(args);
Config orgConfig = cmdLine.loadConfig(options);
Config config = Util.rewriteConfig(orgConfig);
ApplicationRunnerOperation op = cmdLine.getOperation(options);
ApplicationRunner appRunner =
ApplicationRunners.getApplicationRunner(ApplicationUtil.fromConfig(config), config);
switch (op) {
case RUN:
appRunner.run();
break;
case KILL:
appRunner.kill();
break;
case STATUS:
System.out.println(appRunner.status());
break;
default:
throw new IllegalArgumentException("Unrecognized operation: " + op);
}
}
}
代码示例来源:origin: org.apache.samza/samza-core
public static void main(String[] args) throws Exception {
ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerCommandLine();
OptionSet options = cmdLine.parser().parse(args);
Config orgConfig = cmdLine.loadConfig(options);
Config config = Util.rewriteConfig(orgConfig);
ApplicationRunnerOperation op = cmdLine.getOperation(options);
ApplicationRunner appRunner =
ApplicationRunners.getApplicationRunner(ApplicationUtil.fromConfig(config), config);
switch (op) {
case RUN:
appRunner.run();
break;
case KILL:
appRunner.kill();
break;
case STATUS:
System.out.println(appRunner.status());
break;
default:
throw new IllegalArgumentException("Unrecognized operation: " + op);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!