use of com.thinkbiganalytics.scheduler.JobIdentifier in project kylo by Teradata.
the class DefaultServiceLevelAgreementScheduler method scheduleServiceLevelAgreement.
/**
* Schedules an SLA to be run
*
* @param sla The SLA to schedule
*/
public void scheduleServiceLevelAgreement(ServiceLevelAgreement sla) {
if (scheduledJobNames.containsKey(sla.getId())) {
unscheduleServiceLevelAgreement(sla);
}
JobIdentifier jobIdentifier = slaJobName(sla);
ServiceLevelAgreement.ID slaId = sla.getId();
// schedule the job
scheduleSlaJob(jobIdentifier, slaId);
log.info("Schedule sla job " + jobIdentifier.getName());
scheduledJobNames.put(sla.getId(), jobIdentifier.getName());
// notify the other schedulers in the cluster of the scheduled job name
if (clusterService.isClustered()) {
clusterService.sendMessageToOthers(QTZ_JOB_SCHEDULED_MESSAGE_TYPE, new ScheduledServiceLevelAgreementClusterMessage(slaId, jobIdentifier));
}
if (!sla.isEnabled()) {
disableServiceLevelAgreement(sla);
}
}
Aggregations