Class HistoryFileManager
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
@Public
@Unstable
public class HistoryFileManager
extends org.apache.hadoop.service.AbstractService
This class provides a way to interact with history files in a thread safe
manor.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.JobListCacheprotected ThreadPoolExecutor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HistoryFileManager.HistoryFileInfocreateHistoryFileInfo(org.apache.hadoop.fs.Path historyFile, org.apache.hadoop.fs.Path confFile, org.apache.hadoop.fs.Path summaryFile, org.apache.hadoop.mapreduce.v2.jobhistory.JobIndexInfo jobIndexInfo, boolean isInDone) protected org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.JobListCacheprotected ThreadPoolExecutorcreateMoveToDoneThreadPool(int numMoveThreads) protected booleandeleteDir(org.apache.hadoop.fs.FileStatus serialDir) protected List<org.apache.hadoop.fs.FileStatus>Finds all history directories with a timestamp component by scanning the filesystem.getFileInfo(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId) protected static List<org.apache.hadoop.fs.FileStatus>scanDirectory(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileContext fc, org.apache.hadoop.fs.PathFilter pathFilter) protected List<org.apache.hadoop.fs.FileStatus>scanDirectoryForHistoryFiles(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileContext fc) protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) voidMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceStart, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
jobListCache
protected org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.JobListCache jobListCache -
moveToDoneExecutor
-
-
Constructor Details
-
HistoryFileManager
public HistoryFileManager()
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
createMoveToDoneThreadPool
-
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
createJobListCache
protected org.apache.hadoop.mapreduce.v2.hs.HistoryFileManager.JobListCache createJobListCache() -
createHistoryFileInfo
protected HistoryFileManager.HistoryFileInfo createHistoryFileInfo(org.apache.hadoop.fs.Path historyFile, org.apache.hadoop.fs.Path confFile, org.apache.hadoop.fs.Path summaryFile, org.apache.hadoop.mapreduce.v2.jobhistory.JobIndexInfo jobIndexInfo, boolean isInDone) -
scanDirectory
@VisibleForTesting protected static List<org.apache.hadoop.fs.FileStatus> scanDirectory(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileContext fc, org.apache.hadoop.fs.PathFilter pathFilter) throws IOException - Throws:
IOException
-
scanDirectoryForHistoryFiles
protected List<org.apache.hadoop.fs.FileStatus> scanDirectoryForHistoryFiles(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileContext fc) throws IOException - Throws:
IOException
-
findTimestampedDirectories
Finds all history directories with a timestamp component by scanning the filesystem. Used when the JobHistory server is started.- Returns:
- list of history directories
- Throws:
IOException
-
getAllFileInfo
- Throws:
IOException
-
getFileInfo
public HistoryFileManager.HistoryFileInfo getFileInfo(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId) throws IOException - Throws:
IOException
-
deleteDir
protected boolean deleteDir(org.apache.hadoop.fs.FileStatus serialDir) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnsupportedFileSystemException, IOException - Throws:
org.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnsupportedFileSystemExceptionIOException
-