本文整理了Java中com.uber.athenax.backend.server.yarn.YarnClusterConfiguration.<init>()
方法的一些代码示例,展示了YarnClusterConfiguration.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClusterConfiguration.<init>()
方法的具体详情如下:
包路径:com.uber.athenax.backend.server.yarn.YarnClusterConfiguration
类名称:YarnClusterConfiguration
方法名:<init>
暂无
代码示例来源:origin: uber/AthenaX
public YarnClusterConfiguration toYarnClusterConfiguration() {
Preconditions.checkNotNull(yarnSite, "yarn.site.location is not configured");
Preconditions.checkNotNull(homeDir, "athenax.home.dir is not configured");
Preconditions.checkNotNull(flinkUberJar, "flink.uber.jar.location is not configured");
YarnConfiguration yarnConf = new YarnConfiguration();
yarnConf.addResource(new Path(URI.create(yarnSite)));
return new YarnClusterConfiguration(
yarnConf, homeDir, new Path(flinkUberJar),
resourcesToLocalize.stream().map(x -> new Path(URI.create(x))).collect(Collectors.toSet()),
additionalJars.stream().map(x -> new Path(URI.create(x))).collect(Collectors.toSet()));
}
}
代码示例来源:origin: uber/AthenaX
private YarnClusterConfiguration prepareYarnCluster() throws IOException, URISyntaxException {
yarnCluster.init(yarnConf);
yarnCluster.start();
yarnConf.set(RM_ADDRESS, yarnCluster.getResourceManager().getConfig().get(RM_ADDRESS));
File yarnSite = new File(workDir, "yarn-site.xml");
try (PrintWriter pw = new PrintWriter(new FileWriter(yarnSite))) {
yarnConf.writeXml(pw);
}
Path flinkUberJar = new Path(new File(workDir, "flink.jar").toURI());
Path flinkConfYaml = new Path(new File(workDir, "flink-conf.yaml").toURI());
@SuppressWarnings("ConstantConditions")
Path log4jPath = new Path(Thread.currentThread().getContextClassLoader().getResource("log4j.properties").toURI());
Set<Path> resourcesToLocalize = new HashSet<>(Arrays.asList(flinkUberJar, flinkConfYaml, log4jPath));
String home = workDir.toURI().toString();
return new YarnClusterConfiguration(
yarnConf,
home,
flinkUberJar,
resourcesToLocalize,
systemJars(yarnSite));
}
内容来源于网络,如有侵权,请联系作者删除!