public class JobHistoryEventHandler extends org.apache.hadoop.service.AbstractService implements org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent>
| Modifier and Type | Class and Description |
|---|---|
protected class |
JobHistoryEventHandler.MetaInfo |
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.yarn.event.AsyncDispatcher |
atsEventDispatcher |
protected Thread |
eventHandlingThread |
protected BlockingQueue<JobHistoryEvent> |
eventQueue |
protected static Map<org.apache.hadoop.mapreduce.v2.api.records.JobId,JobHistoryEventHandler.MetaInfo> |
fileMap |
protected boolean |
forceJobCompletion |
protected boolean |
handleTimelineEvent |
protected org.apache.hadoop.yarn.client.api.TimelineClient |
timelineClient |
protected org.apache.hadoop.yarn.client.api.TimelineV2Client |
timelineV2Client |
| Constructor and Description |
|---|
JobHistoryEventHandler(AppContext context,
int startCount) |
| Modifier and Type | Method and Description |
|---|---|
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.yarn.event.AsyncDispatcher |
createDispatcher() |
protected org.apache.hadoop.mapreduce.jobhistory.EventWriter |
createEventWriter(org.apache.hadoop.fs.Path historyFilePath) |
void |
handle(JobHistoryEvent event) |
void |
handleEvent(JobHistoryEvent event) |
protected void |
moveTmpToDone(org.apache.hadoop.fs.Path tmpPath) |
protected boolean |
moveToDoneNow(org.apache.hadoop.fs.Path fromPath,
org.apache.hadoop.fs.Path toPath) |
protected void |
processDoneFiles(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId) |
void |
processEventForJobSummary(org.apache.hadoop.mapreduce.jobhistory.HistoryEvent event,
JobSummary summary,
org.apache.hadoop.mapreduce.v2.api.records.JobId jobId) |
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
protected void |
serviceStart() |
protected void |
serviceStop() |
void |
setForcejobCompletion(boolean forceJobCompletion) |
protected void |
setupEventWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId,
org.apache.hadoop.mapreduce.jobhistory.AMStartedEvent amStartedEvent)
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, waitForServiceToStopprotected BlockingQueue<JobHistoryEvent> eventQueue
protected boolean handleTimelineEvent
protected org.apache.hadoop.yarn.event.AsyncDispatcher atsEventDispatcher
protected Thread eventHandlingThread
protected static final Map<org.apache.hadoop.mapreduce.v2.api.records.JobId,JobHistoryEventHandler.MetaInfo> fileMap
protected volatile boolean forceJobCompletion
@VisibleForTesting protected org.apache.hadoop.yarn.client.api.TimelineClient timelineClient
@VisibleForTesting protected org.apache.hadoop.yarn.client.api.TimelineV2Client timelineV2Client
public JobHistoryEventHandler(AppContext context, int startCount)
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.AbstractServiceExceptionprotected org.apache.hadoop.yarn.event.AsyncDispatcher createDispatcher()
protected void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionprotected void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionprotected org.apache.hadoop.mapreduce.jobhistory.EventWriter createEventWriter(org.apache.hadoop.fs.Path historyFilePath)
throws IOException
IOExceptionprotected void setupEventWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId,
org.apache.hadoop.mapreduce.jobhistory.AMStartedEvent amStartedEvent)
throws IOException
jobId - the jobId.amStartedEvent - IOExceptionpublic void closeWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId id)
throws IOException
IOExceptionpublic void handle(JobHistoryEvent event)
handle in interface org.apache.hadoop.yarn.event.EventHandler<JobHistoryEvent>@InterfaceAudience.Private public void handleEvent(JobHistoryEvent event)
public void processEventForJobSummary(org.apache.hadoop.mapreduce.jobhistory.HistoryEvent event,
JobSummary summary,
org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
protected void closeEventWriter(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
throws IOException
IOExceptionprotected void processDoneFiles(org.apache.hadoop.mapreduce.v2.api.records.JobId jobId)
throws IOException
IOExceptionprotected void moveTmpToDone(org.apache.hadoop.fs.Path tmpPath)
throws IOException
IOExceptionprotected boolean moveToDoneNow(org.apache.hadoop.fs.Path fromPath,
org.apache.hadoop.fs.Path toPath)
throws IOException
IOExceptionpublic void setForcejobCompletion(boolean forceJobCompletion)
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.