private static void updateJobStatePercentAndChildId(Configuration conf,
      String jobId, String percent, String childid) {
    JobState state = null;
    try {
      if (percent != null || childid != null) {
        state = new JobState(jobId, conf);
        if (percent != null) {
          state.setPercentComplete(percent);
        }
        if (childid != null) {
          JobState childState = new JobState(childid, conf);
          childState.setParent(jobId);
          state.addChild(childid);
          state.close();
        }
      }
    } catch (IOException e) {
      LOG.error("templeton: state error: ", e);
    } finally {
      if (state != null) {
        try {
          state.close();
        } catch (IOException e) {
          LOG.warn("Caught exception while closing job state ", e);
        }
      }
    }
  }
Updates the job state percent and childid in the templeton storage. Update only
takes place for non-null values.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/LaunchMapper.java