public static boolean startTimer(String method) throws MetaException {
    Deadline deadline = getCurrentDeadline();
    if (deadline == null) {
      throw MetaStoreUtils.newMetaException(new DeadlineException("The threadlocal Deadline is null," +
          " please register it first."));
    }
    if (deadline.startTime != NO_DEADLINE) return false;
    deadline.method = method;
    do {
      deadline.startTime = System.nanoTime();
    } while (deadline.startTime == NO_DEADLINE);
    return true;
  }
start the timer before a method is invoked.
@param method method to be invoked
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Deadline.java