private void check() throws MetaException{
    try {
      if (startTime == NO_DEADLINE) {
        throw new DeadlineException("Should execute startTimer() method before " +
            "checkTimeout. Error happens in method: " + method);
      }
      long elapsedTime = System.nanoTime() - startTime;
      if (elapsedTime > timeoutNanos) {
        throw new DeadlineException("Timeout when executing method: " + method + "; "
            + (elapsedTime / 1000000L) + "ms exceeds " + (timeoutNanos / 1000000L)  + "ms");
      }
    } catch (DeadlineException e) {
      throw MetaStoreUtils.newMetaException(e);
    }
  }
Check whether the long running method timeout.
@throws MetaException when the method timeout
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Deadline.java