public T run() throws Exception {
    try {
      return execute();
    } catch(Exception e) {
      if (e.getClass().equals(retryExceptionType)){
        tries++;
        if (MAX_RETRIES == tries) {
          throw e;
        } else {
          return run();
        }
      } else {
        throw e;
      }
    }
  }
Class to implement any retry logic in case of exceptions.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/Retry.java