use of com.thinkbiganalytics.scheduler.TriggerIdentifier in project kylo by Teradata.
the class NifiStatsJmsReceiver method scheduleStatsCompaction.
/**
* Schedule the compaction job in Quartz if the properties have this enabled with a Cron Expression
*/
private void scheduleStatsCompaction() {
if (compactStatsEnabled && StringUtils.isNotBlank(compactStatsCronSchedule)) {
QuartzScheduler scheduler = (QuartzScheduler) jobScheduler;
JobIdentifier jobIdentifier = new DefaultJobIdentifier("Compact NiFi Processor Stats", "KYLO");
TriggerIdentifier triggerIdentifier = new DefaultTriggerIdentifier(jobIdentifier.getName(), jobIdentifier.getGroup());
try {
scheduler.scheduleJob(jobIdentifier, triggerIdentifier, NiFiStatsCompactionQuartzJobBean.class, compactStatsCronSchedule, null);
} catch (ObjectAlreadyExistsException e) {
log.info("Unable to schedule the job to compact the NiFi processor stats. It already exists. Most likely another Kylo node has already schceduled this job. ");
} catch (SchedulerException e) {
throw new RuntimeException("Error scheduling job: Compact NiFi Processor Stats", e);
}
}
}
use of com.thinkbiganalytics.scheduler.TriggerIdentifier in project kylo by Teradata.
the class DefaultServiceLevelAgreementScheduler method scheduleSlaJob.
/**
* Schedule the SlaQuartzJobBean for the given sla
*
* @param jobIdentifier the job identifier for this schedule
* @param slaId the SLA id
*/
private void scheduleSlaJob(JobIdentifier jobIdentifier, ServiceLevelAgreement.ID slaId) {
QuartzScheduler scheduler = (QuartzScheduler) jobScheduler;
TriggerIdentifier triggerIdentifier = triggerIdentifier(jobIdentifier);
Map<String, Object> map = new HashMap<String, Object>();
map.put(SlaQuartzJobBean.SLA_ID_PARAM, slaId);
try {
scheduler.scheduleJob(jobIdentifier, triggerIdentifier, SlaQuartzJobBean.class, (StringUtils.isBlank(defaultCron) ? DEFAULT_CRON : defaultCron), map);
} catch (SchedulerException e) {
throw new RuntimeException("Error scheduling job", e);
}
}
Aggregations