org.apache.hadoop.mapreduce.jobhistory
Class JobHistoryEventHandler
java.lang.Object
org.apache.hadoop.yarn.service.AbstractService
org.apache.hadoop.mapreduce.jobhistory.JobHistoryEventHandler
- All Implemented Interfaces:
- org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent>, org.apache.hadoop.yarn.service.Service
public class JobHistoryEventHandler
- extends org.apache.hadoop.yarn.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.yarn.service.Service |
org.apache.hadoop.yarn.service.Service.STATE |
|
Method Summary |
protected void |
closeEventWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
|
void |
closeWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId id)
Close the event writer for this id |
protected org.apache.hadoop.mapreduce.jobhistory.EventWriter |
createEventWriter(org.apache.hadoop.fs.Path historyFilePath)
|
void |
handle(JobHistoryEvent event)
|
protected void |
handleEvent(JobHistoryEvent event)
|
void |
init(org.apache.hadoop.conf.Configuration conf)
|
void |
processEventForJobSummary(org.apache.hadoop.mapreduce.jobhistory.HistoryEvent event,
JobSummary summary,
org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
|
protected void |
setupEventWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
Create an event writer for the Job represented by the jobID. |
void |
start()
|
void |
stop()
|
| Methods inherited from class org.apache.hadoop.yarn.service.AbstractService |
getConfig, getName, getServiceState, getStartTime, register, unregister |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
eventQueue
protected BlockingQueue<JobHistoryEvent> eventQueue
eventHandlingThread
protected Thread eventHandlingThread
JobHistoryEventHandler
public JobHistoryEventHandler(AppContext context,
int startCount)
init
public void init(org.apache.hadoop.conf.Configuration conf)
- Specified by:
init in interface org.apache.hadoop.yarn.service.Service- Overrides:
init in class org.apache.hadoop.yarn.service.AbstractService
start
public void start()
- Specified by:
start in interface org.apache.hadoop.yarn.service.Service- Overrides:
start in class org.apache.hadoop.yarn.service.AbstractService
stop
public void stop()
- Specified by:
stop in interface org.apache.hadoop.yarn.service.Service- Overrides:
stop in class org.apache.hadoop.yarn.service.AbstractService
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)
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.
- 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
protected 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
Copyright © 2012 Apache Software Foundation. All Rights Reserved.