org.apache.hadoop.yarn.util.YarnVersionInfo.getBuildVersion()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(14.5k)|赞(0)|评价(0)|浏览(142)

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

YarnVersionInfo.getBuildVersion介绍

[英]Returns the buildVersion which includes version, revision, user and date.
[中]返回buildVersion,其中包括版本、修订、用户和日期。

代码示例

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

public ClusterInfo(ResourceManager rm) {
 long ts = ResourceManager.getClusterTimeStamp();
 this.id = ts;
 this.state = rm.getServiceState();
 this.haState = rm.getRMContext().getHAServiceState();
 this.rmStateStoreName = rm.getRMContext().getStateStore().getClass()
   .getName();
 this.startedOn = ts;
 this.resourceManagerVersion = YarnVersionInfo.getVersion();
 this.resourceManagerBuildVersion = YarnVersionInfo.getBuildVersion();
 this.resourceManagerVersionBuiltOn = YarnVersionInfo.getDate();
 this.hadoopVersion = VersionInfo.getVersion();
 this.hadoopBuildVersion = VersionInfo.getBuildVersion();
 this.hadoopVersionBuiltOn = VersionInfo.getDate();
 this.haZooKeeperConnectionState =
   rm.getRMContext().getHAZookeeperConnectionState();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public ClusterInfo(ResourceManager rm) {
 long ts = ResourceManager.getClusterTimeStamp();
 this.id = ts;
 this.state = rm.getServiceState();
 this.haState = rm.getRMContext().getHAServiceState();
 this.rmStateStoreName = rm.getRMContext().getStateStore().getClass()
   .getName();
 this.startedOn = ts;
 this.resourceManagerVersion = YarnVersionInfo.getVersion();
 this.resourceManagerBuildVersion = YarnVersionInfo.getBuildVersion();
 this.resourceManagerVersionBuiltOn = YarnVersionInfo.getDate();
 this.hadoopVersion = VersionInfo.getVersion();
 this.hadoopBuildVersion = VersionInfo.getBuildVersion();
 this.hadoopVersionBuiltOn = VersionInfo.getDate();
 this.haZooKeeperConnectionState =
   rm.getRMContext().getRMAdminService().getHAZookeeperConnectionState();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

public ClusterInfo(ResourceManager rm) {
 long ts = ResourceManager.getClusterTimeStamp();
 this.id = ts;
 this.state = rm.getServiceState();
 this.haState = rm.getRMContext().getHAServiceState();
 this.rmStateStoreName = rm.getRMContext().getStateStore().getClass()
   .getName();
 this.startedOn = ts;
 this.resourceManagerVersion = YarnVersionInfo.getVersion();
 this.resourceManagerBuildVersion = YarnVersionInfo.getBuildVersion();
 this.resourceManagerVersionBuiltOn = YarnVersionInfo.getDate();
 this.hadoopVersion = VersionInfo.getVersion();
 this.hadoopBuildVersion = VersionInfo.getBuildVersion();
 this.hadoopVersionBuiltOn = VersionInfo.getDate();
 this.haZooKeeperConnectionState =
   rm.getRMContext().getRMAdminService().getHAZookeeperConnectionState();
}

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

public static TimelineAbout createTimelineAbout(String about) {
 TimelineAbout tsInfo = new TimelineAbout(about);
 tsInfo.setHadoopBuildVersion(VersionInfo.getBuildVersion());
 tsInfo.setHadoopVersion(VersionInfo.getVersion());
 tsInfo.setHadoopVersionBuiltOn(VersionInfo.getDate());
 tsInfo.setTimelineServiceBuildVersion(YarnVersionInfo.getBuildVersion());
 tsInfo.setTimelineServiceVersion(YarnVersionInfo.getVersion());
 tsInfo.setTimelineServiceVersionBuiltOn(YarnVersionInfo.getDate());
 return tsInfo;
}

代码示例来源:origin: io.hops/hadoop-yarn-common

/**
  * Test the yarn version info routines.
  * @throws IOException
  */
 @Test
 public void versionInfoGenerated() throws IOException {

  // can't easily know what the correct values are going to be so just
  // make sure they aren't Unknown
  assertTrue("getVersion returned Unknown", !YarnVersionInfo.getVersion().equals("Unknown"));
  assertTrue("getUser returned Unknown", !YarnVersionInfo.getUser().equals("Unknown"));
  assertTrue("getUrl returned Unknown", !YarnVersionInfo.getUrl().equals("Unknown"));
  assertTrue("getSrcChecksum returned Unknown", !YarnVersionInfo.getSrcChecksum().equals("Unknown"));

  // these could be Unknown if the VersionInfo generated from code not in svn or git
  // so just check that they return something
  assertNotNull("getRevision returned null", YarnVersionInfo.getRevision());
  assertNotNull("getBranch returned null", YarnVersionInfo.getBranch());

  assertTrue("getBuildVersion check doesn't contain: source checksum",
        YarnVersionInfo.getBuildVersion().contains("source checksum"));

 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

/**
  * Test the yarn version info routines.
  * @throws IOException
  */
 @Test
 public void versionInfoGenerated() throws IOException {

  // can't easily know what the correct values are going to be so just
  // make sure they aren't Unknown
  assertTrue("getVersion returned Unknown", !YarnVersionInfo.getVersion().equals("Unknown"));
  assertTrue("getUser returned Unknown", !YarnVersionInfo.getUser().equals("Unknown"));
  assertTrue("getUrl returned Unknown", !YarnVersionInfo.getUrl().equals("Unknown"));
  assertTrue("getSrcChecksum returned Unknown", !YarnVersionInfo.getSrcChecksum().equals("Unknown"));

  // these could be Unknown if the VersionInfo generated from code not in svn or git
  // so just check that they return something
  assertNotNull("getRevision returned null", YarnVersionInfo.getRevision());
  assertNotNull("getBranch returned null", YarnVersionInfo.getBranch());

  assertTrue("getBuildVersion check doesn't contain: source checksum",
        YarnVersionInfo.getBuildVersion().contains("source checksum"));

 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

public NodeInfo(final Context context, final ResourceView resourceView) {
 this.id = context.getNodeId().toString();
 this.nodeHostName = context.getNodeId().getHost();
 this.totalVmemAllocatedContainersMB = resourceView
   .getVmemAllocatedForContainers() / BYTES_IN_MB;
 this.vmemCheckEnabled = resourceView.isVmemCheckEnabled();
 this.totalPmemAllocatedContainersMB = resourceView
   .getPmemAllocatedForContainers() / BYTES_IN_MB;
 this.pmemCheckEnabled = resourceView.isPmemCheckEnabled();
 this.totalVCoresAllocatedContainers = resourceView
   .getVCoresAllocatedForContainers();
 this.nodeHealthy = context.getNodeHealthStatus().getIsNodeHealthy();
 this.lastNodeUpdateTime = context.getNodeHealthStatus()
   .getLastHealthReportTime();
 this.healthReport = context.getNodeHealthStatus().getHealthReport();
 this.nodeManagerVersion = YarnVersionInfo.getVersion();
 this.nodeManagerBuildVersion = YarnVersionInfo.getBuildVersion();
 this.nodeManagerVersionBuiltOn = YarnVersionInfo.getDate();
 this.hadoopVersion = VersionInfo.getVersion();
 this.hadoopBuildVersion = VersionInfo.getBuildVersion();
 this.hadoopVersionBuiltOn = VersionInfo.getDate();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

public NodeInfo(final Context context, final ResourceView resourceView) {
 this.id = context.getNodeId().toString();
 this.nodeHostName = context.getNodeId().getHost();
 this.totalVmemAllocatedContainersMB = resourceView
   .getVmemAllocatedForContainers() / BYTES_IN_MB;
 this.vmemCheckEnabled = resourceView.isVmemCheckEnabled();
 this.totalPmemAllocatedContainersMB = resourceView
   .getPmemAllocatedForContainers() / BYTES_IN_MB;
 this.pmemCheckEnabled = resourceView.isPmemCheckEnabled();
 this.totalVCoresAllocatedContainers = resourceView
   .getVCoresAllocatedForContainers();
 this.nodeHealthy = context.getNodeHealthStatus().getIsNodeHealthy();
 this.lastNodeUpdateTime = context.getNodeHealthStatus()
   .getLastHealthReportTime();
 this.healthReport = context.getNodeHealthStatus().getHealthReport();
 this.nodeManagerVersion = YarnVersionInfo.getVersion();
 this.nodeManagerBuildVersion = YarnVersionInfo.getBuildVersion();
 this.nodeManagerVersionBuiltOn = YarnVersionInfo.getDate();
 this.hadoopVersion = VersionInfo.getVersion();
 this.hadoopBuildVersion = VersionInfo.getBuildVersion();
 this.hadoopVersionBuiltOn = VersionInfo.getDate();
}

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

/**
  * Test the yarn version info routines.
  * @throws IOException
  */
 @Test
 public void versionInfoGenerated() throws IOException {

  // can't easily know what the correct values are going to be so just
  // make sure they aren't Unknown
  assertNotEquals("getVersion returned Unknown",
    "Unknown", YarnVersionInfo.getVersion());
  assertNotEquals("getUser returned Unknown",
    "Unknown", YarnVersionInfo.getUser());
  assertNotEquals("getSrcChecksum returned Unknown",
    "Unknown", YarnVersionInfo.getSrcChecksum());

  // these could be Unknown if the VersionInfo generated from code not in svn or git
  // so just check that they return something
  assertNotNull("getUrl returned null", YarnVersionInfo.getUrl());
  assertNotNull("getRevision returned null", YarnVersionInfo.getRevision());
  assertNotNull("getBranch returned null", YarnVersionInfo.getBranch());

  assertTrue("getBuildVersion check doesn't contain: source checksum",
        YarnVersionInfo.getBuildVersion().contains("source checksum"));

 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public void verifyClusterGeneric(long clusterid, long startedon,
  String state, String haState, String haZooKeeperConnectionState,
  String hadoopVersionBuiltOn,
  String hadoopBuildVersion, String hadoopVersion,
  String resourceManagerVersionBuiltOn, String resourceManagerBuildVersion,
  String resourceManagerVersion) {
 assertEquals("clusterId doesn't match: ",
   ResourceManager.getClusterTimeStamp(), clusterid);
 assertEquals("startedOn doesn't match: ",
   ResourceManager.getClusterTimeStamp(), startedon);
 assertTrue("stated doesn't match: " + state,
   state.matches(STATE.INITED.toString()));
 assertTrue("HA state doesn't match: " + haState,
   haState.matches("INITIALIZING"));
 WebServicesTestUtils.checkStringMatch("hadoopVersionBuiltOn",
   VersionInfo.getDate(), hadoopVersionBuiltOn);
 WebServicesTestUtils.checkStringEqual("hadoopBuildVersion",
   VersionInfo.getBuildVersion(), hadoopBuildVersion);
 WebServicesTestUtils.checkStringMatch("hadoopVersion",
   VersionInfo.getVersion(), hadoopVersion);
 WebServicesTestUtils.checkStringMatch("resourceManagerVersionBuiltOn",
   YarnVersionInfo.getDate(), resourceManagerVersionBuiltOn);
 WebServicesTestUtils.checkStringEqual("resourceManagerBuildVersion",
   YarnVersionInfo.getBuildVersion(), resourceManagerBuildVersion);
 WebServicesTestUtils.checkStringMatch("resourceManagerVersion",
   YarnVersionInfo.getVersion(), resourceManagerVersion);
}

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

public void verifyClusterGeneric(long clusterid, long startedon,
  String state, String haState, String haZooKeeperConnectionState,
  String hadoopVersionBuiltOn,
  String hadoopBuildVersion, String hadoopVersion,
  String resourceManagerVersionBuiltOn, String resourceManagerBuildVersion,
  String resourceManagerVersion) {
 assertEquals("clusterId doesn't match: ",
   ResourceManager.getClusterTimeStamp(), clusterid);
 assertEquals("startedOn doesn't match: ",
   ResourceManager.getClusterTimeStamp(), startedon);
 assertTrue("stated doesn't match: " + state,
   state.matches(STATE.INITED.toString()));
 assertTrue("HA state doesn't match: " + haState,
   haState.matches("INITIALIZING"));
 WebServicesTestUtils.checkStringMatch("hadoopVersionBuiltOn",
   VersionInfo.getDate(), hadoopVersionBuiltOn);
 WebServicesTestUtils.checkStringEqual("hadoopBuildVersion",
   VersionInfo.getBuildVersion(), hadoopBuildVersion);
 WebServicesTestUtils.checkStringMatch("hadoopVersion",
   VersionInfo.getVersion(), hadoopVersion);
 WebServicesTestUtils.checkStringMatch("resourceManagerVersionBuiltOn",
   YarnVersionInfo.getDate(), resourceManagerVersionBuiltOn);
 WebServicesTestUtils.checkStringEqual("resourceManagerBuildVersion",
   YarnVersionInfo.getBuildVersion(), resourceManagerBuildVersion);
 WebServicesTestUtils.checkStringMatch("resourceManagerVersion",
   YarnVersionInfo.getVersion(), resourceManagerVersion);
}

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

resourceManagerVersionBuiltOn);
WebServicesTestUtils.checkStringEqual("resourceManagerBuildVersion",
                   YarnVersionInfo.getBuildVersion(), resourceManagerBuildVersion);
WebServicesTestUtils.checkStringMatch("resourceManagerVersion",
                   YarnVersionInfo.getVersion(),

代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager

public NodeInfo(final Context context, final ResourceView resourceView) {
 this.id = context.getNodeId().toString();
 this.nodeHostName = context.getNodeId().getHost();
 this.totalVmemAllocatedContainersMB = resourceView
   .getVmemAllocatedForContainers() / BYTES_IN_MB;
 this.vmemCheckEnabled = resourceView.isVmemCheckEnabled();
 this.totalPmemAllocatedContainersMB = resourceView
   .getPmemAllocatedForContainers() / BYTES_IN_MB;
 this.pmemCheckEnabled = resourceView.isPmemCheckEnabled();
 this.totalVCoresAllocatedContainers = resourceView
   .getVCoresAllocatedForContainers();
 this.totalGPUsAllocatedContainers = resourceView
   .getGPUsAllocatedForContainers();
 this.nodeHealthy = context.getNodeHealthStatus().getIsNodeHealthy();
 this.lastNodeUpdateTime = context.getNodeHealthStatus()
   .getLastHealthReportTime();
 this.healthReport = context.getNodeHealthStatus().getHealthReport();
 this.nodeManagerVersion = YarnVersionInfo.getVersion();
 this.nodeManagerBuildVersion = YarnVersionInfo.getBuildVersion();
 this.nodeManagerVersionBuiltOn = YarnVersionInfo.getDate();
 this.hadoopVersion = VersionInfo.getVersion();
 this.hadoopBuildVersion = VersionInfo.getBuildVersion();
 this.hadoopVersionBuiltOn = VersionInfo.getDate();
 this.nmStartupTime = NodeManager.getNMStartupTime();
}

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

public NodeInfo(final Context context, final ResourceView resourceView) {
 this.id = context.getNodeId().toString();
 this.nodeHostName = context.getNodeId().getHost();
 this.totalVmemAllocatedContainersMB = resourceView
   .getVmemAllocatedForContainers() / BYTES_IN_MB;
 this.vmemCheckEnabled = resourceView.isVmemCheckEnabled();
 this.totalPmemAllocatedContainersMB = resourceView
   .getPmemAllocatedForContainers() / BYTES_IN_MB;
 this.pmemCheckEnabled = resourceView.isPmemCheckEnabled();
 this.totalVCoresAllocatedContainers = resourceView
   .getVCoresAllocatedForContainers();
 this.resourceTypes = StringUtils.join(", ",
   ResourceUtils.getResourcesTypeInfo());
 this.nodeHealthy = context.getNodeHealthStatus().getIsNodeHealthy();
 this.lastNodeUpdateTime = context.getNodeHealthStatus()
   .getLastHealthReportTime();
 this.healthReport = context.getNodeHealthStatus().getHealthReport();
 this.nodeManagerVersion = YarnVersionInfo.getVersion();
 this.nodeManagerBuildVersion = YarnVersionInfo.getBuildVersion();
 this.nodeManagerVersionBuiltOn = YarnVersionInfo.getDate();
 this.hadoopVersion = VersionInfo.getVersion();
 this.hadoopBuildVersion = VersionInfo.getBuildVersion();
 this.hadoopVersionBuiltOn = VersionInfo.getDate();
 this.nmStartupTime = NodeManager.getNMStartupTime();
}

相关文章