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));
    }
  }
相关推荐
小邓睡不饱耶2 小时前
Hadoop:从架构原理到企业级实战,大数据处理入门到精通
大数据·hadoop·架构
Francek Chen3 小时前
【大数据基础】大数据处理架构Hadoop:03 Hadoop的安装与使用
大数据·hadoop·分布式·架构
小邓睡不饱耶3 小时前
Hadoop 进阶:企业级项目实战、生态深度整合与故障排查
大数据·hadoop·分布式
小邓睡不饱耶3 小时前
深耕 Hadoop:内核优化、分布式一致性与大规模集群实战
大数据·hadoop·分布式
weixin_462446231 天前
Hive Metastore 使用 MySQL 8(CJ 驱动)完整配置实战(含完整 Shell 脚本)
hive·hadoop·mysql
zhangkaixuan4562 天前
Paimon 读取数据流程深度解析
大数据·hadoop·flink·apache·paimon
yumgpkpm2 天前
在AI语言大模型时代 Cloudera CDP(华为CMP 鲲鹏版)对自有知识的保护
人工智能·hadoop·华为·zookeeper·spark·kafka
zhangxl-jc2 天前
Hive基本操作日记
数据仓库·hive·hadoop
计算机毕业编程指导师2 天前
【Python大数据选题】基于Hadoop+Spark奥运会金牌榜可视化分析系统源码 毕业设计 选题推荐 毕设选题 数据分析 机器学习 数据挖掘
大数据·hadoop·python·计算机·spark·毕业设计·奥运会金牌
TTBIGDATA2 天前
【Hue】Hue 访问 Hadoop 权限问题出现 403 的解决办法
大数据·hadoop·分布式·ambari·hdp·hue·bigtop