code: protected static String getInstancesFolder(FileSystem fS, Configuration conf) throws IOException {
      return conf.get(HDFS_TMP_FOLDER_CONF, fS.equals(FileSystem.getLocal(conf)) ? DEFAULT_LOCAL_TMP_FOLDER_CONF_VALUE
          : DEFAULT_HDFS_TMP_FOLDER_CONF_VALUE);
    }
docs: http://stackoverflow.com/questions/23903113/mapreduce-error-usergroupinformation-priviledgedactionexception