public int progress(RunningJob rj, JobClient jc, Context ctx) throws IOException, LockException {
    jobId = rj.getID();

    int returnVal = 0;

    // remove the pwd from conf file so that job tracker doesn't show this
    // logs
    String pwd = HiveConf.getVar(job, HiveConf.ConfVars.METASTORE_PWD);
    if (pwd != null) {
      HiveConf.setVar(job, HiveConf.ConfVars.METASTORE_PWD, "HIVE");
    }

    // replace it back
    if (pwd != null) {
      HiveConf.setVar(job, HiveConf.ConfVars.METASTORE_PWD, pwd);
    }

    // add to list of running jobs to kill in case of abnormal shutdown

    runningJobs.add(rj);

    ExecDriverTaskHandle th = new ExecDriverTaskHandle(jc, rj, ctx);
    jobInfo(rj);
    MapRedStats mapRedStats = progress(th);

    this.task.taskHandle = th;
    // Not always there is a SessionState. Sometimes ExeDriver is directly invoked
    // for special modes. In that case, SessionState.get() is empty.
    if (SessionState.get() != null) {
      SessionState.get().getMapRedStats().put(getId(), mapRedStats);

      // Computes the skew for all the MapReduce irrespective
      // of Success or Failure
      if (this.task.getQueryPlan() != null) {
        computeReducerTimeStatsPerJob(rj);
      }
    }

    boolean success = mapRedStats.isSuccess();

    String statusMesg = getJobEndMsg(rj.getID());
    if (!success) {
      statusMesg += " with errors";
      returnVal = 2;
      console.printError(statusMesg);
      if (HiveConf.getBoolVar(job, HiveConf.ConfVars.SHOW_JOB_FAIL_DEBUG_INFO) ||
          HiveConf.getBoolVar(job, HiveConf.ConfVars.JOB_DEBUG_CAPTURE_STACKTRACES)) {
        try {
          JobDebugger jd;
          if (SessionState.get() != null) {
            jd = new JobDebugger(job, rj, console, SessionState.get().getStackTraces());
          } else {
            jd = new JobDebugger(job, rj, console);
          }
          Thread t = new Thread(jd);
          t.start();
          t.join(HiveConf.getIntVar(job, HiveConf.ConfVars.JOB_DEBUG_TIMEOUT));
          task.setDiagnosticMessage(jd.getDiagnosticMesg());
          int ec = jd.getErrorCode();
          if (ec > 0) {
            returnVal = ec;
          }
        } catch (InterruptedException e) {
          console.printError("Timed out trying to grab more detailed job failure"
              + " information, please check jobtracker for more info");
        }
      }
    } else {
      console.printInfo(statusMesg);
    }

    return returnVal;
  }
This class contains the state of the running task Going forward, we will return this handle
from execute and Driver can split execute into start, monitorProgess and postProcess.
ql/src/java/org/apache/hadoop/hive/ql/exec/mr/HadoopJobExecHelper.java