private void updateMapRedStatsJson(MapRedStats stats, RunningJob rj) throws IOException, JSONException {
      if (statsJSON == null) {
        statsJSON = new JSONObject();
      }
      if (stats != null) {
        if (stats.getNumMap() >= 0) {
          statsJSON.put(NUMBER_OF_MAPPERS, stats.getNumMap());
        }
        if (stats.getNumReduce() >= 0) {
          statsJSON.put(NUMBER_OF_REDUCERS, stats.getNumReduce());
        }
        if (stats.getCounters() != null) {
          statsJSON.put(COUNTERS, getCountersJson(stats.getCounters()));
        }
      }
      if (rj != null) {
        statsJSON.put(JOB_ID, rj.getID().toString());
        statsJSON.put(JOB_FILE, rj.getJobFile());
        statsJSON.put(TRACKING_URL, rj.getTrackingURL());
        statsJSON.put(MAP_PROGRESS, Math.round(rj.mapProgress() * 100));
        statsJSON.put(REDUCE_PROGRESS, Math.round(rj.reduceProgress() * 100));
        statsJSON.put(CLEANUP_PROGRESS, Math.round(rj.cleanupProgress() * 100));
        statsJSON.put(SETUP_PROGRESS, Math.round(rj.setupProgress() * 100));
        statsJSON.put(COMPLETE, rj.isComplete());
        statsJSON.put(SUCCESSFUL, rj.isSuccessful());
      }
    }
Preferred objectMapper for this class.

It must be used to have things work in shaded environment (and its also more performant).
ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java