code: private Optional<UfsStatus> syncPersistDirectory(InodeDirectoryView dir)
        throws FileDoesNotExistException, IOException, InvalidPathException {
      AlluxioURI uri = getPath(dir);
      MountTable.Resolution resolution = mMountTable.resolve(uri);
      String ufsUri = resolution.getUri().toString();
      try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) {
        UnderFileSystem ufs = ufsResource.get();
        MkdirsOptions mkdirsOptions =
            MkdirsOptions.defaults(ServerConfiguration.global()).setCreateParent(false)
            .setOwner(dir.getOwner()).setGroup(dir.getGroup()).setMode(new Mode(dir.getMode()));
        if (!ufs.mkdirs(ufsUri, mkdirsOptions)) {
          // Directory might already exist. Try loading the status from ufs.
          UfsStatus status;
          try {
            status = ufs.getStatus(ufsUri);
          } catch (Exception e) {
            throw new IOException(String.format("Cannot create or load UFS directory %s: %s.",
                ufsUri, e.toString()), e);
          }
          if (status.isFile()) {
            throw new InvalidPathException(String.format(
                "Error persisting directory. A file exists at the UFS location %s.", ufsUri));
          }
          return Optional.of(status);
        }
      }
      return Optional.empty();
    }
docs: Persists the directory to the UFS, returning the UFS status if the directory is found to
  already exist in the UFS.
  
  @param dir the directory to persist
  @return optional ufs status if the directory already existed