private IJobStatusStore resolveJobStatusStore( IJobStatusStore configSerializer) { IJobStatusStore serial = configSerializer; if (serial == null) { serial = new FileJobStatusStore(workdir); } LOG.info("JEF job status store is : " + serial.getClass().getSimpleName()); return serial; }
@Override public final void backup( final String suiteName, final String jobId, final Date backupDate) throws IOException { File progressFile = getStatusFile(suiteName, jobId); File backupFile = getBackupFile(suiteName, jobId, backupDate); if (progressFile.exists()) { FileUtil.moveFile(progressFile, backupFile); } }
/** * Gets the file used to store the job progress. * @param suiteName name space given to the job progress * @param jobId the job unique name * @return file used to store the job process */ private File getStatusFile(final String suiteName, final String jobId) { resolveDirsIfNeeded(); return new File(jobdirLatest + "/" + FileUtil.toSafeFileName(suiteName) + "__" + FileUtil.toSafeFileName(jobId) + ".job"); } /**
throws IOException { resolveDirsIfNeeded(); MutableJobStatus jobStatus = new MutableJobStatus(jobId); File file = getStatusFile(suiteName, jobId);
@Override public final void remove(final String suiteName, final String jobId) throws IOException { File file = getStatusFile(suiteName, jobId); FileUtil.delete(file); }
@Override public void loadFromXML(Reader in) throws IOException { XMLConfiguration xml = XMLConfigurationUtil.newXMLConfiguration(in); setStatusDirectory(xml.getString("statusDir", statusDir)); }
@Override public long touch(String suiteName, String jobId) throws IOException { File file = getStatusFile(suiteName, jobId); FileUtils.touch(file); return file.lastModified(); }
suiteConfig.setLogManager(new FileLogManager(collConfig.getLogsDir())); suiteConfig.setJobStatusStore( new FileJobStatusStore(collConfig.getProgressDir())); suiteConfig.setWorkdir(collConfig.getProgressDir());
File file = getStatusFile(suiteName, jobStatus.getJobId()); if (LOG.isDebugEnabled()) { LOG.debug("Writing status file: " + file);
resolveDirsIfNeeded(); String date = new SimpleDateFormat( "yyyyMMddHHmmssSSSS").format(backupDate);