public synchronized Long getElapsedTime() {
      if (endTime == null) {
        if (beginTime == null) {
          return null;
        }
        return System.currentTimeMillis() - beginTime;
      } else {
        return endTime - beginTime;
      }
    }
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