gpt4 book ai didi

com.uber.athenax.backend.server.yarn.YarnClusterConfiguration.conf()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 17:48:31 31 4
gpt4 key购买 nike

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

YarnClusterConfiguration.conf介绍

[英]The configuration used by YARN (i.e.,

yarn-site.xml

).
[中]纱线使用的配置(即

yarn-site.xml

)。

代码示例

代码示例来源:origin: uber/AthenaX

AthenaXYarnClusterDescriptor(
  YarnClusterConfiguration clusterConf,
  YarnClient yarnClient,
  Configuration flinkConf,
  JobConf job) {
 super(new Configuration(flinkConf),
   clusterConf.conf(),
   "",
   yarnClient,
   true);
 this.clusterConf = clusterConf;
 this.yarnClient = yarnClient;
 this.flinkConf = flinkConf;
 this.job = job;
}

代码示例来源:origin: uber/AthenaX

private LocalResource toLocalResource(Path path, LocalResourceVisibility visibility) throws IOException {
 FileSystem fs = path.getFileSystem(clusterConf.conf());
 FileStatus stat = fs.getFileStatus(path);
 return LocalResource.newInstance(
     ConverterUtils.getYarnUrlFromPath(path),
     LocalResourceType.FILE,
     visibility,
     stat.getLen(), stat.getModificationTime()
 );
}

代码示例来源:origin: uber/AthenaX

private Map<String, String> setUpAmEnvironment(
  ApplicationId appId,
  String amClassPath,
  String shipFiles,
  String dynamicProperties) throws IOException {
 final Map<String, String> env = new HashMap<>();
 // set Flink app class path
 env.put(YarnConfigKeys.ENV_FLINK_CLASSPATH, amClassPath);
 // set Flink on YARN internal configuration values
 env.put(YarnConfigKeys.ENV_TM_COUNT, String.valueOf(job.taskManagerCount()));
 env.put(YarnConfigKeys.ENV_TM_MEMORY, String.valueOf(job.taskManagerMemoryMb()));
 env.put(YarnConfigKeys.FLINK_JAR_PATH, clusterConf.flinkUberJar().toString());
 env.put(YarnConfigKeys.ENV_APP_ID, appId.toString());
 env.put(YarnConfigKeys.ENV_CLIENT_HOME_DIR, clusterConf.homeDir());
 env.put(YarnConfigKeys.ENV_CLIENT_SHIP_FILES, shipFiles);
 env.put(YarnConfigKeys.ENV_SLOTS, "-1");
 env.put(YarnConfigKeys.ENV_DETACHED, "true");
 // https://github.com/apache/hadoop/blob/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnApplicationSecurity.md#identity-on-an-insecure-cluster-hadoop_user_name
 env.put(YarnConfigKeys.ENV_HADOOP_USER_NAME,
   UserGroupInformation.getCurrentUser().getUserName());
 if (dynamicProperties != null) {
  env.put(YarnConfigKeys.ENV_DYNAMIC_PROPERTIES, dynamicProperties);
 }
 // set classpath from YARN configuration
 Utils.setupYarnClassPath(clusterConf.conf(), env);
 return env;
}

代码示例来源:origin: uber/AthenaX

ClusterInfo(String name, YarnClusterConfiguration conf) {
 this.name = name;
 this.client = YarnClient.createYarnClient();
 client.init(conf.conf());
 client.start();
 this.conf = conf;
}

代码示例来源:origin: uber/AthenaX

@Test
 public void testDeployerWithIsolatedConfiguration() throws Exception {
  YarnClusterConfiguration clusterConf = mock(YarnClusterConfiguration.class);
  doReturn(new YarnConfiguration()).when(clusterConf).conf();
  ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
  Configuration flinkConf = new Configuration();
  YarnClient client = mock(YarnClient.class);
  JobDeployer deploy = new JobDeployer(clusterConf, client, executor, flinkConf);
  AthenaXYarnClusterDescriptor desc = mock(AthenaXYarnClusterDescriptor.class);

  YarnClusterClient clusterClient = mock(YarnClusterClient.class);
  doReturn(clusterClient).when(desc).deploy();

  ActorGateway actorGateway = mock(ActorGateway.class);
  doReturn(actorGateway).when(clusterClient).getJobManagerGateway();
  doReturn(Future$.MODULE$.successful(null)).when(actorGateway).ask(any(), any());

  JobGraph jobGraph = mock(JobGraph.class);
  doReturn(JobID.generate()).when(jobGraph).getJobID();
  deploy.start(desc, jobGraph);

  verify(clusterClient).runDetached(jobGraph, null);
 }
}

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com