code: public static void persistAndWait(final FileSystem fs, final AlluxioURI uri, int timeoutMs)
        throws FileDoesNotExistException, IOException, AlluxioException, TimeoutException,
        InterruptedException {
      fs.persist(uri);
      CommonUtils.waitFor(String.format("%s to be persisted", uri) , () -> {
        try {
          return fs.getStatus(uri).isPersisted();
        } catch (Exception e) {
          Throwables.throwIfUnchecked(e);
          throw new RuntimeException(e);
        }
      }, WaitForOptions.defaults().setTimeoutMs(timeoutMs)
          .setInterval(Constants.SECOND_MS));
    }
docs: Persists the given path to the under file system and returns once the persist is complete.
  Note that if this method times out, the persist may still occur after the timeout period.
  
  @param fs {@link FileSystem} to carry out Alluxio operations
  @param uri the uri of the file to persist
  @param timeoutMs max amount of time to wait for persist in milliseconds. -1 to wait
  indefinitely
  @throws TimeoutException if the persist takes longer than the timeout