@VisibleForTesting public boolean jobOutputDirectoryExists(JobId jobId) { final Path jobOutputDir = getJobOutputDir(jobId); try { return dfs.exists(jobOutputDir); } catch (IOException e) { return false; } }
public boolean cleanup(JobId jobId) { final Path jobOutputDir = getJobOutputDir(jobId); try { if (dfs.exists(jobOutputDir)) { dfs.delete(jobOutputDir, true); logger.info("Deleted job output directory : " + jobOutputDir); } return true; } catch (IOException e) { logger.warn("Could not delete job output directory : " + jobOutputDir, e); return false; } }
final Path jobOutputDir = getJobOutputDir(jobId); if (!dfs.isDirectory(jobOutputDir)) { throw UserException.dataReadError()