org.apache.hadoop.mapreduce.jobhistory
Class JobHistoryEventHandler
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler
- All Implemented Interfaces:
- Closeable, org.apache.hadoop.service.Service, org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent>
public class JobHistoryEventHandler
- extends org.apache.hadoop.service.AbstractService
- implements org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent>
The job history events get routed to this class. This class writes the Job
history events to the DFS directly into a staging dir and then moved to a
done-dir. JobHistory implementation is in this package to access package
private classes.
| Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service |
org.apache.hadoop.service.Service.STATE |
| 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, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop |
eventQueue
protected BlockingQueue<JobHistoryEvent> eventQueue
eventHandlingThread
protected Thread eventHandlingThread
fileMap
protected static final Map<org.apache.hadoop.mapreduce.v2.api.records.JobId,JobHistoryEventHandler.MetaInfo> fileMap
forceJobCompletion
protected volatile boolean forceJobCompletion
JobHistoryEventHandler
public JobHistoryEventHandler(AppContext context,
int startCount)
serviceInit
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
- Overrides:
serviceInit in class org.apache.hadoop.service.AbstractService
- Throws:
Exception
serviceStart
protected void serviceStart()
throws Exception
- Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
- Throws:
Exception
serviceStop
protected void serviceStop()
throws Exception
- Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService
- Throws:
Exception
createEventWriter
protected org.apache.hadoop.mapreduce.jobhistory.EventWriter createEventWriter(org.apache.hadoop.fs.Path historyFilePath)
throws IOException
- Throws:
IOException
setupEventWriter
protected void setupEventWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId,
String forcedJobStateOnShutDown)
throws IOException
- Create an event writer for the Job represented by the jobID.
Writes out the job configuration to the log directory.
This should be the first call to history for a job
- Parameters:
jobId - the jobId.forcedJobStateOnShutDown -
- Throws:
IOException
closeWriter
public void closeWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId id)
throws IOException
- Close the event writer for this id
- Throws:
IOException
handle
public void handle(JobHistoryEvent event)
- Specified by:
handle in interface org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent>
handleEvent
@InterfaceAudience.Private
public void handleEvent(JobHistoryEvent event)
processEventForJobSummary
public void processEventForJobSummary(org.apache.hadoop.mapreduce.jobhistory.HistoryEvent event,
JobSummary summary,
org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
closeEventWriter
protected void closeEventWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
throws IOException
- Throws:
IOException
processDoneFiles
protected void processDoneFiles(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
throws IOException
- Throws:
IOException
setForcejobCompletion
public void setForcejobCompletion(boolean forceJobCompletion)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.