gpt4 book ai didi

org.apache.hadoop.yarn.conf.YarnConfiguration.timelineServiceV1Enabled()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 02:00:40 31 4
gpt4 key购买 nike

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

YarnConfiguration.timelineServiceV1Enabled介绍

[英]Returns whether the timeline service v.1 is enabled via configuration.
[中]返回timeline service v.1是否通过配置启用。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client

if (YarnConfiguration.timelineServiceV1Enabled(conf)) {
 timelineV1ServiceEnabled = true;
 timelineDTRenewer = getTimelineDelegationTokenRenewer(conf);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

protected SystemMetricsPublisher createSystemMetricsPublisher() {
 List<SystemMetricsPublisher> publishers =
   new ArrayList<SystemMetricsPublisher>();
 if (YarnConfiguration.timelineServiceV1Enabled(conf)) {
  SystemMetricsPublisher publisherV1 = new TimelineServiceV1Publisher();
  publishers.add(publisherV1);
 }
 if (YarnConfiguration.timelineServiceV2Enabled(conf)) {
  // we're dealing with the v.2.x publisher
  LOG.info("system metrics publisher with the timeline service V2 is "
    + "configured");
  SystemMetricsPublisher publisherV2 = new TimelineServiceV2Publisher(
    rmContext.getRMTimelineCollectorManager());
  publishers.add(publisherV2);
 }
 if (publishers.isEmpty()) {
  LOG.info("TimelineServicePublisher is not configured");
  SystemMetricsPublisher noopPublisher = new NoOpSystemMetricPublisher();
  publishers.add(noopPublisher);
 }
 for (SystemMetricsPublisher publisher : publishers) {
  addIfService(publisher);
 }
 SystemMetricsPublisher combinedPublisher =
   new CombinedSystemMetricsPublisher(publishers);
 return combinedPublisher;
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

protected void serviceInit(Configuration conf) throws Exception {
 if (!YarnConfiguration.timelineServiceV1Enabled(conf)) {
  throw new IOException("Timeline V1 client is not properly configured. "
    + "Either timeline service is not enabled or version is not set to"

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-applications-distributedshell

@Override
 public Void run() throws Exception {
  if (YarnConfiguration.timelineServiceEnabled(conf)) {
   timelineServiceV1Enabled =
     YarnConfiguration.timelineServiceV1Enabled(conf);
   timelineServiceV2Enabled =
     YarnConfiguration.timelineServiceV2Enabled(conf);
   // Creating the Timeline Client
   if (timelineServiceV1Enabled) {
    timelineClient = TimelineClient.createTimelineClient();
    timelineClient.init(conf);
    timelineClient.start();
    LOG.info("Timeline service V1 client is enabled");
   }
   if (timelineServiceV2Enabled) {
    timelineV2Client = TimelineV2Client.createTimelineClient(
      appAttemptID.getApplicationId());
    timelineV2Client.init(conf);
    timelineV2Client.start();
    LOG.info("Timeline service V2 client is enabled");
   }
  } else {
   timelineClient = null;
   timelineV2Client = null;
   LOG.warn("Timeline service is not enabled");
  }
  return null;
 }
});

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test(timeout = 10000)
public void testTimelineServiceConfiguration()
  throws Exception {
 Configuration config = new Configuration(false);
 config.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
 config.set(YarnConfiguration.TIMELINE_SERVICE_VERSIONS, "2.0,1.5");
 config.set(YarnConfiguration.TIMELINE_SERVICE_VERSION, "2.0");
 Assert.assertTrue(YarnConfiguration.timelineServiceV2Enabled(config));
 Assert.assertTrue(YarnConfiguration.timelineServiceV15Enabled(config));
 Assert.assertTrue(YarnConfiguration.timelineServiceV1Enabled(config));
 config.set(YarnConfiguration.TIMELINE_SERVICE_VERSIONS, "2.0,1");
 config.set(YarnConfiguration.TIMELINE_SERVICE_VERSION, "1.5");
 Assert.assertTrue(YarnConfiguration.timelineServiceV2Enabled(config));
 Assert.assertFalse(YarnConfiguration.timelineServiceV15Enabled(config));
 Assert.assertTrue(YarnConfiguration.timelineServiceV1Enabled(config));
 config.set(YarnConfiguration.TIMELINE_SERVICE_VERSIONS, "2.0");
 config.set(YarnConfiguration.TIMELINE_SERVICE_VERSION, "1.5");
 Assert.assertTrue(YarnConfiguration.timelineServiceV2Enabled(config));
 Assert.assertFalse(YarnConfiguration.timelineServiceV15Enabled(config));
 Assert.assertFalse(YarnConfiguration.timelineServiceV1Enabled(config));
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

new ArrayList<SystemMetricsPublisher>();
if (YarnConfiguration.timelineServiceV1Enabled(conf)) {
 Assert.assertTrue(enableV1);
 publisherV1 = new TimelineServiceV1Publisher();

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