/** * Scans old directories known by the idToDateString map for the specified jobId. If the number of * directories is higher than the supported size of the idToDateString cache, the jobId will not * be found. * * @param jobId the jobId. * @return * @throws IOException */ private HistoryFileInfo scanOldDirsForJob(JobId jobId) throws IOException { String boxedSerialNumber = JobHistoryUtils.serialNumberDirectoryComponent(jobId, serialNumberFormat); Set<String> dateStringSet = serialNumberIndex.get(boxedSerialNumber); if (dateStringSet == null) { return null; } for (String timestampPart : dateStringSet) { Path logDir = canonicalHistoryLogPath(jobId, timestampPart); List<FileStatus> fileStatusList = scanDirectoryForHistoryFiles(logDir, doneDirFc); HistoryFileInfo fileInfo = getJobFileInfo(fileStatusList, jobId); if (fileInfo != null) { return fileInfo; } } return null; }
private void removeDirectoryFromSerialNumberIndex(Path serialDirPath) { String serialPart = serialDirPath.getName(); String timeStampPart = JobHistoryUtils.getTimestampPartFromPath(serialDirPath.toString()); if (timeStampPart == null) { LOG.warn( "Could not find timestamp portion from path: " + serialDirPath.toString() + ". Continuing with next"); return; } if (serialPart == null) { LOG.warn( "Could not find serial portion from path: " + serialDirPath.toString() + ". Continuing with next"); return; } serialNumberIndex.remove(serialPart, timeStampPart); }
private void removeDirectoryFromSerialNumberIndex(Path serialDirPath) { String serialPart = serialDirPath.getName(); String timeStampPart = JobHistoryUtils.getTimestampPartFromPath(serialDirPath.toString()); if (timeStampPart == null) { /* LOG.warn("Could not find timestamp portion from path: "+serialDirPath.toString()+". Continuing with next") */ LOG.could_not_find_timestamp_portion_from_co(String.valueOf(serialDirPath.toString())) .tag("methodCall") .warn(); return; } if (serialPart == null) { /* LOG.warn("Could not find serial portion from path: "+serialDirPath.toString()+". Continuing with next") */ LOG.could_not_find_serial_portion_from_conti(String.valueOf(serialDirPath.toString())) .tag("methodCall") .warn(); return; } serialNumberIndex.remove(serialPart, timeStampPart); }
private void addDirectoryToSerialNumberIndex(Path serialDirPath) { if (LogGlobal.isDebugEnabled()) { /* LOG.debug("Adding "+serialDirPath+" to serial index") */ LOG.adding_serial_index(serialDirPath.toString()).debug(); } String serialPart = serialDirPath.getName(); String timestampPart = JobHistoryUtils.getTimestampPartFromPath(serialDirPath.toString()); if (timestampPart == null) { /* LOG.warn("Could not find timestamp portion from path: "+serialDirPath+". Continuing with next") */ LOG.could_not_find_timestamp_portion_from_co(serialDirPath.toString()).warn(); return; } if (serialPart == null) { /* LOG.warn("Could not find serial portion from path: "+serialDirPath.toString()+". Continuing with next") */ LOG.could_not_find_serial_portion_from_conti(String.valueOf(serialDirPath.toString())) .tag("methodCall") .warn(); } else { serialNumberIndex.add(serialPart, timestampPart); } }
private void addDirectoryToSerialNumberIndex(Path serialDirPath) { if (LOG.isDebugEnabled()) { LOG.debug("Adding " + serialDirPath + " to serial index"); } String serialPart = serialDirPath.getName(); String timestampPart = JobHistoryUtils.getTimestampPartFromPath(serialDirPath.toString()); if (timestampPart == null) { LOG.warn( "Could not find timestamp portion from path: " + serialDirPath + ". Continuing with next"); return; } if (serialPart == null) { LOG.warn( "Could not find serial portion from path: " + serialDirPath.toString() + ". Continuing with next"); } else { serialNumberIndex.add(serialPart, timestampPart); } }