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 天前
大数据第四篇:事故复盘:移走 HBase 里 27 个 hadoop-2.10.2 jar 后,HMaster 半小时后“自杀“了【jar 事故复盘】
jvm·hadoop·hbase·异常处理·大数据运维·踩坑记录·事故复盘
Francek Chen2 天前
【大数据处理与分析】数据仓库Hive:08 Impala
数据仓库·hive·hadoop·数据分析·impala
ha_lydms3 天前
Window Functions(窗口函数)
大数据·数据仓库·hadoop·spark·数据处理·dataworks·maxcompute
ha_lydms3 天前
Xml Functions(XML 函数)
xml·大数据·hadoop·spark·数据处理·dataworks·maxcompute
ha_lydms3 天前
Vector Functions(向量函数)
大数据·hadoop·spark·数据处理·dataworks·maxcompute·数据中台
ha_lydms3 天前
阿里云大数据组件
大数据·hadoop·阿里云·spark·云计算·数据处理·dataworks
ruxshui4 天前
Hadoop 生产运维实战手册
大数据·运维·hadoop
泡干脆面就番茄4 天前
Hive窗口函数:从原理到三大面试题
大数据·数据仓库·hive·hadoop
程序员梅雨4 天前
Hive面试总结
hive·hadoop·面试
ha_lydms6 天前
Datetime Functions(日期时间函数)
大数据·hadoop·阿里云·spark·数据处理·dataworks·maxcompute