boolean createDir(Path dir) throws IOException {
    int i = 0;
    IOException lastIOE = null;
    do {
      try {
        return mkdirs(fs, conf, dir);
      } catch (IOException ioe) {
        lastIOE = ioe;
        if (fs.exists(dir)) return true; // directory is present
        try {
          sleepBeforeRetry("Create Directory", i + 1);
        } catch (InterruptedException e) {
          throw (InterruptedIOException) new InterruptedIOException().initCause(e);
        }
      }
    } while (++i <= hdfsClientRetriesNumber);
    throw new IOException("Exception in createDir", lastIOE);
  }
Creates a directory. Assumes the user has already checked for this directory existence.
@return the result of fs.mkdirs(). In case underlying fs throws an IOException, it checks
        whether the directory exists or not, and returns true if it exists.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java