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 SLACalculator
ServiceException
public int size()
size
in interface SLACalculator
public SLACalcStatus get(String jobId) throws JPAExecutorException
get
in interface SLACalculator
JPAExecutorException
public Iterator<String> iterator()
iterator
in interface SLACalculator
public boolean isEmpty()
isEmpty
in interface SLACalculator
public void clear()
clear
in interface SLACalculator
protected void updateJobSla(String jobId) throws Exception
Exception
public void updateAllSlaStatus()
updateAllSlaStatus
in interface SLACalculator
public boolean addRegistration(String jobId, SLARegistrationBean reg) throws JPAExecutorException
addRegistration
in interface SLACalculator
JPAExecutorException
public boolean updateRegistration(String jobId, SLARegistrationBean reg) throws JPAExecutorException
updateRegistration
in interface SLACalculator
JPAExecutorException
public void removeRegistration(String jobId)
removeRegistration
in interface SLACalculator
public boolean addJobStatus(String jobId, String jobStatus, org.apache.oozie.client.event.JobEvent.EventStatus jobEventStatus, Date startTime, Date endTime) throws JPAExecutorException, ServiceException
addJobStatus
in interface SLACalculator
JPAExecutorException
ServiceException
public boolean isJobIdInSLAMap(String jobId)
public boolean isJobIdInHistorySet(String jobId)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.