use of com.thinkbiganalytics.scheduler.QuartzScheduler in project kylo by Teradata.
the class DefaultServiceLevelAgreementScheduler method disableServiceLevelAgreement.
/**
* Used to disable the schedule of the SLA, so that it no longer executes until subsequently re-enabled
*
* @param sla The SLA to disable
*/
public void disableServiceLevelAgreement(ServiceLevelAgreement sla) {
ServiceLevelAgreement.ID slaId = sla.getId();
JobIdentifier scheduledJobId = null;
if (scheduledJobNames.containsKey(slaId)) {
scheduledJobId = jobIdentifierForName(scheduledJobNames.get(slaId));
} else {
scheduledJobId = jobIdentifierForName(sla.getName());
}
QuartzScheduler scheduler = (QuartzScheduler) jobScheduler;
if (scheduledJobId != null && scheduler.jobExists(scheduledJobId)) {
try {
jobScheduler.pauseTriggersOnJob(scheduledJobId);
} catch (JobSchedulerException e) {
log.error("Unable to pause the schedule for the disabled SLA {} ", sla.getName());
}
} else {
log.info("Unable to pause the SLA job {} . The Job does not exist", sla.getName());
}
}
Aggregations