private void updateJobStateToDoneAndWriteExitValue(Configuration conf,
      String statusdir, String jobId, int exitCode) throws IOException {
    writeExitValue(conf, exitCode, statusdir);
    JobState state = new JobState(jobId, conf);
    state.setExitValue(exitCode);
    state.setCompleteStatus("done");
    state.close();

    if (exitCode != 0) {
      LOG.info("templeton: job failed with exit code "
              + exitCode);
    } else {
      LOG.info("templeton: job completed with exit code 0");
    }
  }
Attempts to reconnect to an already running child job of the templeton launcher. This
is used in cases where the templeton launcher task has failed and is retried by the
MR framework. If reconnect to the child job is possible, the method will continue
tracking its progress until completion.
@return Returns true if reconnect was successful, false if not supported or
        no child jobs were found.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/LaunchMapper.java