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));
    }
  }
相关推荐
毕设源码-钟学长1 小时前
【开题答辩全过程】以 基于Hadoop的新闻推荐系统为例,包含答辩的问题和答案
大数据·hadoop·分布式
TTBIGDATA10 小时前
【Knox编译】xmlsectool 依赖缺失问题解析
大数据·hadoop·ambari·hdp·kerberos·knox·bigtop
TTBIGDATA17 小时前
【Knox编译】webhdfs-test 依赖收敛冲突问题处理
大数据·hadoop·ambari·hdp·kerberos·knox·bigtop
心止水j1 天前
hive问题
数据仓库·hive·hadoop
心止水j1 天前
hive桶
数据仓库·hive·hadoop
心止水j1 天前
hive 分区总结
数据仓库·hive·hadoop
走遍西兰花.jpg1 天前
在hive中实现拉链表的更新和merge into
数据仓库·hive·hadoop
zgl_200537791 天前
ZGLanguage 解析SQL数据血缘 之 提取子查询语句中的源表名
大数据·数据库·数据仓库·hive·hadoop·sql·etl
qq_12498707531 天前
基于Hadoop的黑龙江旅游景点推荐系统的设计与实现(源码+论文+部署+安装)
大数据·hadoop·分布式·python·信息可视化
laocooon5238578861 天前
大专Hadoop课程考试方案设计
大数据·hadoop·分布式