Yarn 之 run job

src/main/java/org/apache/hadoop/mapreduce/Job.java

cpp 复制代码
  /**
   * Monitor a job and print status in real-time as progress is made and tasks 
   * fail.
   * @return true if the job succeeded
   * @throws IOException if communication to the JobTracker fails
   */
  public boolean monitorAndPrintJob() 
      throws IOException, InterruptedException {
    String lastReport = null;
    Job.TaskStatusFilter filter;
    Configuration clientConf = getConfiguration();
    filter = Job.getTaskOutputFilter(clientConf);
    JobID jobId = getJobID();
    LOG.info("Running job: " + jobId);
    int eventCounter = 0;
    boolean profiling = getProfileEnabled();
cpp 复制代码
  /** Key in mapred-*.xml that sets progMonitorPollIntervalMillis */
  public static final String PROGRESS_MONITOR_POLL_INTERVAL_KEY =
    "mapreduce.client.progressmonitor.pollinterval";
  /** Default progMonitorPollIntervalMillis is 1000 ms. */
  static final int DEFAULT_MONITOR_POLL_INTERVAL = 1000;
cpp 复制代码
while (!isComplete() || !reportedAfterCompletion) {
      if (isComplete()) {
        reportedAfterCompletion = true;
      } else {
        Thread.sleep(progMonitorPollIntervalMillis);
      }
      if (status.getState() == JobStatus.State.PREP) {
        continue;
      }      
      if (!reportedUberMode) {
        reportedUberMode = true;
        LOG.info("Job " + jobId + " running in uber mode : " + isUber());
      }      
      String report = 
        (" map " + StringUtils.formatPercent(mapProgress(), 0)+
            " reduce " + 
            StringUtils.formatPercent(reduceProgress(), 0));
      if (!report.equals(lastReport)) {
        LOG.info(report);
        lastReport = report;
      }

      TaskCompletionEvent[] events = 
        getTaskCompletionEvents(eventCounter, 10); 
      eventCounter += events.length;
      printTaskEvents(events, filter, profiling, mapRanges, reduceRanges);
    }
相关推荐
2501_948106911 分钟前
计算机毕业设计之jsp物业管理系统
java·大数据·开发语言·汽车·课程设计
葡萄城技术团队4 分钟前
AI 不会淘汰电子表格,反而会让电子表格成为 AI 操作系统
前端·人工智能
BigTopOne5 分钟前
Short Put and Short Call
前端
黑taoA8 分钟前
深度解析:Maven核心命令(clean、compile、package、install)与IDEA多模块项目避坑指南
java·maven·intellij-idea
TDengine (老段)10 分钟前
TDengine 索引使用指南 — 何时建、怎么建、怎么用
java·大数据·数据库·物联网·时序数据库·tdengine·涛思数据
逝水无殇12 分钟前
C# 反射详解
开发语言·后端·c#
Cache技术分享16 分钟前
465. Java 反射 - 获取类的简单名
前端·后端
BigTopOne25 分钟前
什么是行权价,什么是权利金,什么是行权?
前端
xlxxy_27 分钟前
sap获取批次特性报表
java·linux·开发语言·前端·数据库·abap·mm
BigTopOne28 分钟前
Long put and Long call
前端