Class CachedHistoryStorage
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.mapreduce.v2.hs.CachedHistoryStorage
- All Implemented Interfaces:
Closeable,AutoCloseable,HistoryStorage,org.apache.hadoop.service.Service
public class CachedHistoryStorage
extends org.apache.hadoop.service.AbstractService
implements HistoryStorage
Manages an in memory cache of parsed Job History files.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMap<org.apache.hadoop.mapreduce.v2.api.records.JobId,org.apache.hadoop.mapreduce.v2.app.job.Job> Get all of the cached jobs.org.apache.hadoop.mapreduce.v2.app.job.JobgetFullJob(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId) Get a fully parsed job.intgetPartialJobs(Long offset, Long count, String user, String queue, Long sBegin, Long sEnd, Long fBegin, Long fEnd, org.apache.hadoop.mapreduce.v2.api.records.JobState jobState) Look for a set of partial jobs.static JobsInfogetPartialJobs(Collection<org.apache.hadoop.mapreduce.v2.app.job.Job> jobs, Long offset, Long count, String user, String queue, Long sBegin, Long sEnd, Long fBegin, Long fEnd, org.apache.hadoop.mapreduce.v2.api.records.JobState jobState) booleanvoidvoidserviceInit(org.apache.hadoop.conf.Configuration conf) voidsetHistoryFileManager(HistoryFileManager hsManager) Give the Storage a reference to a class that can be used to interact with history files.Methods 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, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
CachedHistoryStorage
public CachedHistoryStorage()
-
-
Method Details
-
setHistoryFileManager
Description copied from interface:HistoryStorageGive the Storage a reference to a class that can be used to interact with history files.- Specified by:
setHistoryFileManagerin interfaceHistoryStorage- Parameters:
hsManager- the class that is used to interact with history files.
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
refreshLoadedJobCache
public void refreshLoadedJobCache() -
getFullJob
public org.apache.hadoop.mapreduce.v2.app.job.Job getFullJob(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId) Description copied from interface:HistoryStorageGet a fully parsed job.- Specified by:
getFullJobin interfaceHistoryStorage- Parameters:
jobId- the id of the job- Returns:
- the job, or null if it is not found.
-
getAllPartialJobs
public Map<org.apache.hadoop.mapreduce.v2.api.records.JobId,org.apache.hadoop.mapreduce.v2.app.job.Job> getAllPartialJobs()Description copied from interface:HistoryStorageGet all of the cached jobs. This only returns partial jobs and is here for legacy reasons.- Specified by:
getAllPartialJobsin interfaceHistoryStorage- Returns:
- all of the cached jobs
-
getPartialJobs
public JobsInfo getPartialJobs(Long offset, Long count, String user, String queue, Long sBegin, Long sEnd, Long fBegin, Long fEnd, org.apache.hadoop.mapreduce.v2.api.records.JobState jobState) Description copied from interface:HistoryStorageLook for a set of partial jobs.- Specified by:
getPartialJobsin interfaceHistoryStorage- Parameters:
offset- the offset into the list of jobs.count- the maximum number of jobs to return.user- only return jobs for the given user.queue- only return jobs for in the given queue.sBegin- only return Jobs that started on or after the given time.sEnd- only return Jobs that started on or before the given time.fBegin- only return Jobs that ended on or after the given time.fEnd- only return Jobs that ended on or before the given time.jobState- only return Jobs that are in the given job state.- Returns:
- The list of filtered jobs.
-
getPartialJobs
-
getUseLoadedTasksCache
@VisibleForTesting public boolean getUseLoadedTasksCache() -
getLoadedTasksCacheSize
@VisibleForTesting public int getLoadedTasksCacheSize()
-