public class SLACalculatorMemory extends Object implements SLACalculator
| Modifier and Type | Class and Description |
|---|---|
class |
SLACalculatorMemory.HistoryPurgeWorker |
| Modifier and Type | Field and Description |
|---|---|
protected EventHandlerService |
eventHandler |
protected Set<String> |
historySet |
protected Map<String,SLACalcStatus> |
slaMap |
| Constructor and Description |
|---|
SLACalculatorMemory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addJobStatus(String jobId,
String jobStatus,
org.apache.oozie.client.event.JobEvent.EventStatus jobEventStatus,
Date startTime,
Date endTime)
Triggered after receiving Job status change event, update SLA status
accordingly
|
boolean |
addRegistration(String jobId,
SLARegistrationBean reg)
Register a new job into the map for SLA tracking
|
void |
clear() |
SLACalcStatus |
get(String jobId) |
void |
init(org.apache.hadoop.conf.Configuration conf) |
boolean |
isEmpty() |
boolean |
isJobIdInHistorySet(String jobId) |
boolean |
isJobIdInSLAMap(String jobId) |
Iterator<String> |
iterator() |
void |
removeRegistration(String jobId)
Remove job from being tracked in map
|
int |
size() |
void |
updateAllSlaStatus()
Periodically run by the SLAService worker threads to update SLA status by
iterating through all the jobs in the map
|
protected void |
updateJobSla(String jobId)
Invoked via periodic run, update the SLA for registered jobs
|
boolean |
updateRegistration(String jobId,
SLARegistrationBean reg)
Update job into the map for SLA tracking
|
protected Map<String,SLACalcStatus> slaMap
protected Set<String> historySet
protected EventHandlerService eventHandler
public SLACalculatorMemory()
public void init(org.apache.hadoop.conf.Configuration conf) throws ServiceException
init in interface SLACalculatorServiceExceptionpublic int size()
size in interface SLACalculatorpublic SLACalcStatus get(String jobId) throws JPAExecutorException
get in interface SLACalculatorJPAExecutorExceptionpublic Iterator<String> iterator()
iterator in interface SLACalculatorpublic boolean isEmpty()
isEmpty in interface SLACalculatorpublic void clear()
clear in interface SLACalculatorprotected void updateJobSla(String jobId) throws Exception
Exceptionpublic void updateAllSlaStatus()
updateAllSlaStatus in interface SLACalculatorpublic boolean addRegistration(String jobId, SLARegistrationBean reg) throws JPAExecutorException
addRegistration in interface SLACalculatorJPAExecutorExceptionpublic boolean updateRegistration(String jobId, SLARegistrationBean reg) throws JPAExecutorException
updateRegistration in interface SLACalculatorJPAExecutorExceptionpublic void removeRegistration(String jobId)
removeRegistration in interface SLACalculatorpublic boolean addJobStatus(String jobId, String jobStatus, org.apache.oozie.client.event.JobEvent.EventStatus jobEventStatus, Date startTime, Date endTime) throws JPAExecutorException, ServiceException
addJobStatus in interface SLACalculatorJPAExecutorExceptionServiceExceptionpublic boolean isJobIdInSLAMap(String jobId)
public boolean isJobIdInHistorySet(String jobId)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.