public class SLAService extends Object implements Service
Modifier and Type | Field and Description |
---|---|
static String |
CONF_ALERT_EVENTS |
static String |
CONF_CALCULATOR_IMPL |
static String |
CONF_CAPACITY |
static String |
CONF_EVENTS_MODIFIED_AFTER |
static String |
CONF_JOB_EVENT_LATENCY |
static String |
CONF_PREFIX |
static String |
CONF_SLA_CALC_LOCK_TIMEOUT |
static String |
CONF_SLA_CHECK_INITIAL_DELAY |
static String |
CONF_SLA_CHECK_INTERVAL |
static String |
CONF_SLA_HISTORY_PURGE_INTERVAL |
static XLog |
LOG |
DEFAULT_LOCK_TIMEOUT, lockTimeout
Constructor and Description |
---|
SLAService() |
Modifier and Type | Method and Description |
---|---|
boolean |
addRegistrationEvent(SLARegistrationBean reg) |
boolean |
addStatusEvent(String jobId,
String status,
JobEvent.EventStatus eventStatus,
Date startTime,
Date endTime) |
boolean |
changeDefinition(List<Pair<String,Map<String,String>>> idSlaDefinitionList)
Change jobs Sla definitions
It takes list of pairs of jobid and key/value pairs of el evaluated sla definition.
|
void |
destroy()
Destroy the service.
|
boolean |
disableAlert(List<String> jobIds)
Disable jobs Sla alert.
|
boolean |
disableChildJobAlert(List<String> parentJobIds)
Disable child jobs Sla alert.
|
boolean |
enableAlert(List<String> jobIds)
Enable jobs sla alert.
|
boolean |
enableChildJobAlert(List<String> parentJobIds)
Enable child jobs sla alert.
|
Class<? extends Service> |
getInterface()
Return the public interface of the service.
|
SLACalculator |
getSLACalculator() |
void |
init(Services services)
Initialize the service.
|
static boolean |
isEnabled() |
void |
removeRegistration(String jobId) |
void |
runSLAWorker() |
void |
startSLAWorker() |
boolean |
updateRegistrationEvent(SLARegistrationBean reg) |
public static final String CONF_PREFIX
public static final String CONF_CALCULATOR_IMPL
public static final String CONF_CAPACITY
public static final String CONF_ALERT_EVENTS
public static final String CONF_EVENTS_MODIFIED_AFTER
public static final String CONF_JOB_EVENT_LATENCY
public static final String CONF_SLA_CHECK_INTERVAL
public static final String CONF_SLA_CHECK_INITIAL_DELAY
public static final String CONF_SLA_CALC_LOCK_TIMEOUT
public static final String CONF_SLA_HISTORY_PURGE_INTERVAL
public SLAService()
public void init(Services services) throws ServiceException
Service
Invoked by the Service
singleton at start up time.
init
in interface Service
services
- services singleton initializing the service.ServiceException
- thrown if the service could not initialize.public void destroy()
Service
Invoked by the Service
singleton at shutdown time.
public Class<? extends Service> getInterface()
Service
Services are retrieved by its public interface. Specializations of services must return the public interface.
getInterface
in interface Service
public static boolean isEnabled()
public SLACalculator getSLACalculator()
public void runSLAWorker()
public void startSLAWorker()
public boolean addRegistrationEvent(SLARegistrationBean reg) throws ServiceException
ServiceException
public boolean updateRegistrationEvent(SLARegistrationBean reg) throws ServiceException
ServiceException
public boolean addStatusEvent(String jobId, String status, JobEvent.EventStatus eventStatus, Date startTime, Date endTime) throws ServiceException
ServiceException
public void removeRegistration(String jobId)
public boolean enableAlert(List<String> jobIds) throws ServiceException
jobIds
- the job idsServiceException
- the service exceptionpublic boolean enableChildJobAlert(List<String> parentJobIds) throws ServiceException
parentJobIds
- the parent job idsServiceException
- the service exceptionpublic boolean disableAlert(List<String> jobIds) throws ServiceException
jobIds
- the job idsServiceException
- the service exceptionpublic boolean disableChildJobAlert(List<String> parentJobIds) throws ServiceException
parentJobIds
- the parent job idsServiceException
- the service exceptionpublic boolean changeDefinition(List<Pair<String,Map<String,String>>> idSlaDefinitionList) throws ServiceException
idSlaDefinitionList
- the job ids sla pairServiceException
- the service exceptionCopyright © 2018 Apache Software Foundation. All rights reserved.