Yarn 之 nodemanager.containermanager.container

src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerState.java

cpp 复制代码
/**
 * States used by the container state machine.
 */
public enum ContainerState {
  // NOTE: In case of future additions / deletions / modifications to this
  //       enum, please ensure that the following are also correspondingly
  //       updated:
  //       1. ContainerImpl::getContainerSubState().
  //       2. the doc in the ContainerSubState class.
  //       3. the doc in the yarn_protos.proto file.
  NEW, LOCALIZING, LOCALIZATION_FAILED, SCHEDULED, RUNNING, RELAUNCHING,
  REINITIALIZING, REINITIALIZING_AWAITING_KILL,
  EXITED_WITH_SUCCESS, EXITED_WITH_FAILURE, KILLING,
  CONTAINER_CLEANEDUP_AFTER_KILL, CONTAINER_RESOURCES_CLEANINGUP, DONE,
  PAUSING, PAUSED, RESUMING
}
cpp 复制代码
      // If this is a recovered container that has already launched, skip
      // uploading resources to the shared cache. We do this to avoid uploading
      // the same resources multiple times. The tradeoff is that in the case of
      // a recovered container, there is a chance that resources don't get
      // uploaded into the shared cache. This is OK because resources are not
      // acknowledged by the SCM until they have been uploaded by the node
      // manager.
      if (container.recoveredStatus != RecoveredContainerStatus.LAUNCHED
          && container.recoveredStatus != RecoveredContainerStatus.COMPLETED) {
        // kick off uploads to the shared cache
        container.dispatcher.getEventHandler().handle(
            new SharedCacheUploadEvent(
                container.resourceSet.getResourcesToBeUploaded(), container
                .getLaunchContext(), container.getUser(),
                SharedCacheUploadEventType.UPLOAD));
      }

      return ContainerState.SCHEDULED;
ContainerLaunch

src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java

cpp 复制代码
  protected void handleContainerExitCode(int exitCode, Path containerLogDir) {
    ContainerId containerId = container.getContainerId();
    LOG.debug("Container {} completed with exit code {}", containerId,
        exitCode);

    StringBuilder diagnosticInfo =
        new StringBuilder("Container exited with a non-zero exit code ");
    diagnosticInfo.append(exitCode);
    diagnosticInfo.append(". ");
    if (exitCode == ExitCode.FORCE_KILLED.getExitCode()
        || exitCode == ExitCode.TERMINATED.getExitCode()) {
      // If the process was killed, Send container_cleanedup_after_kill and
      // just break out of this method.
      dispatcher.getEventHandler().handle(
          new ContainerExitEvent(containerId,
              ContainerEventType.CONTAINER_KILLED_ON_REQUEST, exitCode,
              diagnosticInfo.toString()));
    } else if (exitCode != 0) {
      handleContainerExitWithFailure(containerId, exitCode, containerLogDir,
          diagnosticInfo);
    } else {
      LOG.info("Container " + containerId + " succeeded ");
      dispatcher.getEventHandler().handle(
          new ContainerEvent(containerId,
              ContainerEventType.CONTAINER_EXITED_WITH_SUCCESS));
    }
  }
相关推荐
暴躁小师兄数据学院20 小时前
【AI大数据工程师特训笔记】第15讲:大数据环境安装
大数据·hadoop·flink·spark
王小王-1231 天前
基于 Hadoop + Flask 的电动汽车数据分析与可视化系统设计与实现
hadoop·数据分析·flask·电动汽车·新能源汽车数据分析·新能源汽车销量分析·新能源汽车销售分析
王小王-1231 天前
基于机器学习与Hadoop的心脏病数据分析与可视化设计与实现
hadoop·机器学习·数据分析·心脏病预测
知识分享小能手1 天前
Hadoop学习教程,从入门到精通, Hadoop 3.x 高可用集群 — 知识点详解(6)
大数据·hadoop·学习
知识分享小能手2 天前
Hadoop学习教程,从入门到精通, ZooKeeper 分布式协调服务 — 全面知识点与案例代码(5)
hadoop·分布式·zookeeper
知识分享小能手3 天前
Hadoop学习教程,从入门到精通, MapReduce分布式计算框架 — 完整知识点与代码案例(4)
hadoop·学习·mapreduce
白日与明月3 天前
Hive子查询中的ORDER BY陷阱:为什么排序“消失”了?
数据仓库·hive·hadoop
段一凡-华北理工大学3 天前
工业领域的Hadoop架构学习~系列文章24:adoop工业应用总结与展望 - 技术路线图与最佳实践
大数据·人工智能·hadoop·分布式·学习·架构·高炉炼铁
段一凡-华北理工大学3 天前
工业领域的Hadoop架构学习~系列文章23:物流行业Hadoop应用实践 - 智能物流的数字化引擎
大数据·人工智能·hadoop·分布式·学习·架构·高炉炼铁
奇点爆破XC4 天前
Hadoop大数据生态(Ambari管理)组件服务详解
大数据·hadoop·ambari