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,
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
|
boolean |
changeDefinition(List<Pair<String,Map<String,String>>> jobIdsSLAPair)
Change jobs Sla definitions
It takes list of pairs of jobid and key/value pairs of el evaluated sla definition.
|
void |
clear() |
boolean |
disableAlert(List<String> jobIds)
Disable jobs Sla alert.
|
boolean |
disableChildJobAlert(List<String> parentJobIds)
Disable Sla alert for child jobs.
|
boolean |
enableAlert(List<String> jobIds)
Enable jobs sla alert.
|
boolean |
enableChildJobAlert(List<String> parentJobIds)
Enable sla alert for child jobs.
|
SLACalcStatus |
get(String jobId) |
Set<String> |
getHistorySet() |
void |
init(org.apache.hadoop.conf.Configuration conf) |
boolean |
isEmpty() |
boolean |
isJobIdInHistorySet(String jobId) |
boolean |
isJobIdInSLAMap(String jobId) |
Iterator<String> |
iterator() |
void |
reloadExpectedTimeAndConfig(SLACalcStatus slaCalc) |
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
|
boolean |
updateSLARegistartion(SLACalcStatus slaCalc) |
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 Set<String> getHistorySet()
public 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, JobEvent.EventStatus jobEventStatus, Date startTime, Date endTime) throws JPAExecutorException, ServiceException
addJobStatus in interface SLACalculatorJPAExecutorExceptionServiceExceptionpublic void reloadExpectedTimeAndConfig(SLACalcStatus slaCalc) throws JPAExecutorException
JPAExecutorExceptionpublic boolean isJobIdInSLAMap(String jobId)
public boolean isJobIdInHistorySet(String jobId)
public boolean enableAlert(List<String> jobIds) throws JPAExecutorException, ServiceException
SLACalculatorenableAlert in interface SLACalculatorjobIds - the job idsJPAExecutorException - the JPA executor exceptionServiceException - the service exceptionpublic boolean enableChildJobAlert(List<String> parentJobIds) throws JPAExecutorException, ServiceException
SLACalculatorenableChildJobAlert in interface SLACalculatorparentJobIds - the parent job idsJPAExecutorExceptionServiceExceptionpublic boolean disableAlert(List<String> jobIds) throws JPAExecutorException, ServiceException
SLACalculatordisableAlert in interface SLACalculatorjobIds - the job idsJPAExecutorException - the JPA executor exceptionServiceException - the service exceptionpublic boolean disableChildJobAlert(List<String> parentJobIds) throws JPAExecutorException, ServiceException
SLACalculatordisableChildJobAlert in interface SLACalculatorparentJobIds - the parent job idsJPAExecutorExceptionServiceExceptionpublic boolean changeDefinition(List<Pair<String,Map<String,String>>> jobIdsSLAPair) throws JPAExecutorException, ServiceException
SLACalculatorchangeDefinition in interface SLACalculatorjobIdsSLAPair - the job ids sla pairJPAExecutorException - the JPA executor exceptionServiceException - the service exceptionpublic boolean updateSLARegistartion(SLACalcStatus slaCalc) throws JPAExecutorException
JPAExecutorExceptionCopyright © 2018 Apache Software Foundation. All rights reserved.