public static <T> Optional<T> retryNoException(
      int maxRetry, long retryIntervalMS, Supplier<T> retryFunc, Function<T, Boolean> validator) {
    for (int i = 0; i < maxRetry; i++) {
      T result = retryFunc.get();
      if (Boolean.TRUE.equals(validator.apply(result))) {
        return Optional.of(result);
      }
      try {
        Thread.sleep(retryIntervalMS);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        return Optional.empty();
      }
    }
    return Optional.empty();
  }
Retry a method at most 'maxRetry' times, each time calling 'retryFunc' and passing the result
to 'validator'. If 'validator' returns true, returns the result.

@param maxRetry maximum number of retires
@param retryIntervalMS retry interval in milliseconds
@param retryFunc function to be retried
@param validator validating the result of 'retryFunc'
@return true if the result from 'retryFunc' passes validation, false if all retries fail or is
    interrupted
@param <T>
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/IOUtils.java