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));
    }
  }
相关推荐
武子康7 分钟前
大数据-264 实时数仓-MySQL Binlog配置详解:从原理到实践|数据恢复与主从复制实战
大数据·hadoop·后端
武子康38 分钟前
大数据-265 实时数仓-Canal MySQL Binlog配置详解:从原理到实践|数据恢复与主从复制实战
大数据·hadoop·后端
晓纪同学1 小时前
WPF-03 第一个WPF程序
大数据·hadoop·wpf
xiaoyaohou119 小时前
024、大数据技术栈概览:Hadoop、Spark与Flink
大数据·hadoop·spark
虚幻如影10 小时前
Hive 中“STRING类型无需显式指定长度
数据仓库·hive·hadoop
仗剑_走天涯1 天前
hadoop reduce阶段 对象重用问题
大数据·hadoop·分布式
仗剑_走天涯1 天前
hadoop 中 yarn node -list 显示0 问题解决
大数据·hadoop·分布式
武子康2 天前
大数据-263 实时数仓-Canal 增量订阅与消费原理:MySQL Binlog 数据同步实践
大数据·hadoop·后端
仗剑_走天涯2 天前
zookeeper 安装与配置
hadoop·zookeeper
zhixingheyi_tian2 天前
hdfs.c 之解析
c语言·hadoop·hdfs