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);
    }
相关推荐
不染尘.2 分钟前
二叉树相关题目
开发语言·数据结构·c++·算法
女王大人万岁8 分钟前
Go标准库 sync 详解
服务器·开发语言·后端·golang
qq_4112624211 分钟前
短时间串口发送网络端怎么接收不到
开发语言·php
静谧空间12 分钟前
java登录验证码CaptchaConfig
java·开发语言
Imxyk16 分钟前
力扣:632. 最小区间(贪心)
java·数据结构·算法
小高Baby@16 分钟前
session、cookie、Jwt-token
开发语言·后端·golang
驱动探索者18 分钟前
linux genpool 学习
java·linux·学习
露天赏雪19 分钟前
JDK8 的入门避坑指南
java·服务器·windows·spring boot·后端·spring·性能优化
maplewen.20 分钟前
C++11 std::mutex
开发语言·c++
jiaguangqingpanda21 分钟前
Day37-20260205
java·开发语言