public class JobHistoryEventHandler extends AbstractService implements EventHandler<JobHistoryEvent>
Modifier and Type | Class and Description |
---|---|
protected class |
JobHistoryEventHandler.MetaInfo |
Service.STATE
Modifier and Type | Field and Description |
---|---|
protected Thread |
eventHandlingThread |
protected BlockingQueue<JobHistoryEvent> |
eventQueue |
protected static Map<JobId,JobHistoryEventHandler.MetaInfo> |
fileMap |
protected boolean |
forceJobCompletion |
Constructor and Description |
---|
JobHistoryEventHandler(AppContext context,
int startCount) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeEventWriter(JobId jobId) |
void |
closeWriter(JobId id)
Close the event writer for this id
|
protected org.apache.hadoop.mapreduce.jobhistory.EventWriter |
createEventWriter(Path historyFilePath) |
void |
handle(JobHistoryEvent event) |
protected void |
handleEvent(JobHistoryEvent event) |
protected void |
processDoneFiles(JobId jobId) |
void |
processEventForJobSummary(HistoryEvent event,
JobSummary summary,
JobId jobId) |
protected void |
serviceInit(Configuration conf)
All initialization code needed by a service.
|
protected void |
serviceStart()
Actions called during the INITED to STARTED transition.
|
protected void |
serviceStop()
Actions called during the transition to the STOPPED state.
|
void |
setForcejobCompletion(boolean forceJobCompletion) |
protected void |
setupEventWriter(JobId jobId)
Create an event writer for the Job represented by the jobID.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
protected BlockingQueue<JobHistoryEvent> eventQueue
protected Thread eventHandlingThread
protected static final Map<JobId,JobHistoryEventHandler.MetaInfo> fileMap
protected volatile boolean forceJobCompletion
public JobHistoryEventHandler(AppContext context, int startCount)
protected void serviceInit(Configuration conf) throws Exception
AbstractService
AbstractService.init(Configuration)
prevents re-entrancy.
The base implementation checks to see if the subclass has created
a new configuration instance, and if so, updates the base class valueserviceInit
in class AbstractService
conf
- configurationException
- on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected void serviceStart() throws Exception
AbstractService
AbstractService.start()
prevents re-entrancy.serviceStart
in class AbstractService
Exception
- if needed -these will be caught,
wrapped, and trigger a service stopprotected void serviceStop() throws Exception
AbstractService
AbstractService.stop()
prevents re-entrancy.
Implementations MUST write this to be robust against failures, including
checks for null references -and for the first failure to not stop other
attempts to shut down parts of the service.serviceStop
in class AbstractService
Exception
- if needed -these will be caught and logged.protected org.apache.hadoop.mapreduce.jobhistory.EventWriter createEventWriter(Path historyFilePath) throws IOException
IOException
protected void setupEventWriter(JobId jobId) throws IOException
jobId
- the jobId.IOException
public void closeWriter(JobId id) throws IOException
IOException
public void handle(JobHistoryEvent event)
handle
in interface EventHandler<JobHistoryEvent>
protected void handleEvent(JobHistoryEvent event)
public void processEventForJobSummary(HistoryEvent event, JobSummary summary, JobId jobId)
protected void closeEventWriter(JobId jobId) throws IOException
IOException
protected void processDoneFiles(JobId jobId) throws IOException
IOException
public void setForcejobCompletion(boolean forceJobCompletion)
Copyright © 2013 Apache Software Foundation. All rights reserved.