private long elapsedTimeInSeconds(long fromTimeMillis) {
    return (System.currentTimeMillis() - fromTimeMillis)/ 1000;
  }
Class to implement any retry logic in case of exceptions.
ql/src/java/org/apache/hadoop/hive/ql/exec/util/Retryable.java