|
@@ -103,6 +103,15 @@ public class JobHistory {
|
|
|
FsPermission.createImmutable((short) 0740); // rwxr-----
|
|
|
private static JobConf jtConf;
|
|
|
private static Path DONE = null; // folder for completed jobs
|
|
|
+ /**
|
|
|
+ * A filter for conf files
|
|
|
+ */
|
|
|
+ private static final PathFilter CONF_FILTER = new PathFilter() {
|
|
|
+ public boolean accept(Path path) {
|
|
|
+ return path.getName().endsWith("_conf.xml");
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
/**
|
|
|
* A class that manages all the files related to a job. For now
|
|
|
* - writers : list of open files
|
|
@@ -937,6 +946,19 @@ public class JobHistory {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Delete job conf from the history folder.
|
|
|
+ */
|
|
|
+ static void deleteConfFiles() throws IOException {
|
|
|
+ LOG.info("Cleaning up config files from the job history folder");
|
|
|
+ FileSystem fs = new Path(LOG_DIR).getFileSystem(jtConf);
|
|
|
+ FileStatus[] status = fs.listStatus(new Path(LOG_DIR), CONF_FILTER);
|
|
|
+ for (FileStatus s : status) {
|
|
|
+ LOG.info("Deleting conf file " + s.getPath());
|
|
|
+ fs.delete(s.getPath(), false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Move the completed job into the completed folder.
|
|
|
* This assumes that the jobhistory file is closed and all operations on the
|