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 |
static String |
INSTRUMENTATION_GROUP |
static String |
SLA_MAP |
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 static final String INSTRUMENTATION_GROUP
public static final String SLA_MAP
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 Set<String> getHistorySet()
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, JobEvent.EventStatus jobEventStatus, Date startTime, Date endTime) throws JPAExecutorException, ServiceException
addJobStatus
in interface SLACalculator
JPAExecutorException
ServiceException
public void reloadExpectedTimeAndConfig(SLACalcStatus slaCalc) throws JPAExecutorException
JPAExecutorException
public boolean isJobIdInSLAMap(String jobId)
public boolean isJobIdInHistorySet(String jobId)
public boolean enableAlert(List<String> jobIds) throws JPAExecutorException, ServiceException
SLACalculator
enableAlert
in interface SLACalculator
jobIds
- the job idsJPAExecutorException
- the JPA executor exceptionServiceException
- the service exceptionpublic boolean enableChildJobAlert(List<String> parentJobIds) throws JPAExecutorException, ServiceException
SLACalculator
enableChildJobAlert
in interface SLACalculator
parentJobIds
- the parent job idsJPAExecutorException
ServiceException
public boolean disableAlert(List<String> jobIds) throws JPAExecutorException, ServiceException
SLACalculator
disableAlert
in interface SLACalculator
jobIds
- the job idsJPAExecutorException
- the JPA executor exceptionServiceException
- the service exceptionpublic boolean disableChildJobAlert(List<String> parentJobIds) throws JPAExecutorException, ServiceException
SLACalculator
disableChildJobAlert
in interface SLACalculator
parentJobIds
- the parent job idsJPAExecutorException
ServiceException
public boolean changeDefinition(List<Pair<String,Map<String,String>>> jobIdsSLAPair) throws JPAExecutorException, ServiceException
SLACalculator
changeDefinition
in interface SLACalculator
jobIdsSLAPair
- the job ids sla pairJPAExecutorException
- the JPA executor exceptionServiceException
- the service exceptionpublic boolean updateSLARegistartion(SLACalcStatus slaCalc) throws JPAExecutorException
JPAExecutorException
Copyright © 2018 Apache Software Foundation. All rights reserved.