protected void createDir(String dir) throws StatefulStorageException {
    Path path = new Path(dir);

    try {
      fileSystem.mkdirs(path);
      if (!fileSystem.exists(path)) {
        throw new StatefulStorageException("Failed to create dir: " + dir);
      }
    } catch (IOException e) {
      throw new StatefulStorageException("Failed to create dir: " + dir, e);
    }
  }
protected void createDir ( String dir ) throws StatefulStorageException { Path path = new Path ( dir ) ; try { fileSystem . mkdirs ( path ) ; if ( ! fileSystem . exists ( path ) ) { throw new StatefulStorageException ( "Failed to create dir: " + dir ) ; } } catch ( IOException e ) { throw new StatefulStorageException ( "Failed to create dir: " + dir , e ) ; } }
Creates the directory if it does not exist.

@param dir The path of dir to ensure existence