org.apache.hadoop.yarn.server.nodemanager.NodeManager.getNodeStatusUpdater()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(93)

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

NodeManager.getNodeStatusUpdater介绍

暂无

代码示例

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

private void waitForContainerToFinishOnNM(ContainerId containerId) {
 Context nmContet = yarnCluster.getNodeManager(0).getNMContext();
 int interval = 4 * 60; // Max time for container token to expire.
 Assert.assertNotNull(nmContet.getContainers().containsKey(containerId));
 while ((interval-- > 0)
   && !nmContet.getContainers().get(containerId)
    .cloneAndGetContainerStatus().getState()
    .equals(ContainerState.COMPLETE)) {
  try {
   LOG.info("Waiting for " + containerId + " to complete.");
   Thread.sleep(1000);
  } catch (InterruptedException e) {
  }
 }
 // Normally, Containers will be removed from NM context after they are
 // explicitly acked by RM. Now, manually remove it for testing.
 yarnCluster.getNodeManager(0).getNodeStatusUpdater()
  .addCompletedContainer(containerId);
 nmContet.getContainers().remove(containerId);
}

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

private void waitForContainerToFinishOnNM(ContainerId containerId)
  throws InterruptedException {
 Context nmContext = yarnCluster.getNodeManager(0).getNMContext();
 // Max time for container token to expire.
 final int timeout = 4 * 60 * 1000;
 // If the container is null, then it has already completed and been removed
 // from the Context by asynchronous calls.
 Container waitContainer = nmContext.getContainers().get(containerId);
 if (waitContainer != null) {
  try {
   LOG.info("Waiting for " + containerId + " to get to state " +
     ContainerState.COMPLETE);
   GenericTestUtils.waitFor(() -> ContainerState.COMPLETE.equals(
     waitContainer.cloneAndGetContainerStatus().getState()),
     500, timeout);
  } catch (TimeoutException te) {
   LOG.error("TimeoutException", te);
   fail("Was waiting for " + containerId + " to get to state " +
     ContainerState.COMPLETE + " but was in state " +
     waitContainer.cloneAndGetContainerStatus().getState() +
     " after the timeout");
  }
 }
 // Normally, Containers will be removed from NM context after they are
 // explicitly acked by RM. Now, manually remove it for testing.
 yarnCluster.getNodeManager(0).getNodeStatusUpdater()
  .addCompletedContainer(containerId);
 LOG.info("Removing container from NMContext, containerID = " + containerId);
 nmContext.getContainers().remove(containerId);
}

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

nm.getNodeStatusUpdater().clearFinishedContainersFromCache();

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

nm.getNodeStatusUpdater().clearFinishedContainersFromCache();

相关文章