@VisibleForTesting
  static void createPath(HiveConf conf, Path path, String permission, boolean isLocal,
      boolean isCleanUp) throws IOException {
    FsPermission fsPermission = new FsPermission(permission);
    FileSystem fs;
    if (isLocal) {
      fs = FileSystem.getLocal(conf);
    } else {
      fs = path.getFileSystem(conf);
    }
    if (!fs.exists(path)) {
      if (!fs.mkdirs(path, fsPermission)) {
        throw new IOException("Failed to create directory " + path + " on fs " + fs.getUri());
      }
      String dirType = isLocal ? "local" : "HDFS";
      LOG.info("Created " + dirType + " directory: " + path.toString());
    }
    if (isCleanUp) {
      fs.deleteOnExit(path);
    }
  }
Create a given path if it doesn't exist.

@param conf
@param path
@param permission
@param isLocal
@param isCleanUp
@return
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java