public static Path getLocalSessionPath(Configuration conf) {
    SessionState ss = SessionState.get();
    if (ss == null) {
      String localPathString = conf.get(LOCAL_SESSION_PATH_KEY);
      Preconditions.checkNotNull(localPathString,
          "Conf local session path expected to be non-null");
      return new Path(localPathString);
    }
    Preconditions.checkNotNull(ss.localSessionPath,
        "Local session path expected to be non-null");
    return ss.localSessionPath;
  }
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