Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ public void scheduleJob(Properties jobProps, JobListener jobListener, Map<String
// Schedule the Quartz job with a trigger built from the job configuration
Trigger trigger = createTriggerForJob(job.getKey(), jobProps);
this.scheduler.getScheduler().scheduleJob(job, trigger);
LOG.info(String.format("Scheduled job %s. Next run: %s.", job.getKey(), trigger.getNextFireTime()));
LOG.info("Scheduler trigger validation: [flowName: {} flowGroup: {}] - nextTriggerTime: {} - "
+ "Job scheduled", job.getKey().getName(), job.getKey().getGroup(), trigger.getNextFireTime());
Comment thread
umustafi marked this conversation as resolved.
Outdated
} catch (SchedulerException se) {
LOG.error("Failed to schedule job " + jobName, se);
throw new JobException("Failed to schedule job " + jobName, se);
Expand Down Expand Up @@ -612,7 +613,10 @@ public void executeImpl(JobExecutionContext context)
long triggerTimestampMillis = trigger.getPreviousFireTime().getTime();
jobProps.setProperty(ConfigurationKeys.SCHEDULER_EVENT_TO_TRIGGER_TIMESTAMP_MILLIS_KEY,
String.valueOf(triggerTimestampMillis));

LOG.info("Scheduler trigger validation: [flowName: {} flowGroup: {}] - triggerTime: {} nextTriggerTime: {} - "
+ "Job triggered by scheduler",
Comment thread
umustafi marked this conversation as resolved.
Outdated
jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY), jobProps.getProperty(ConfigurationKeys.JOB_GROUP_KEY),
triggerTimestampMillis, trigger.getNextFireTime().getTime());
try {
jobScheduler.runJob(jobProps, jobListener);
} catch (Throwable t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.TimeZone;

import org.apache.commons.lang.StringUtils;
import org.apache.gobblin.runtime.api.SpecNotFoundException;
import org.apache.helix.HelixManager;
import org.quartz.CronExpression;
import org.quartz.DisallowConcurrentExecution;
Expand Down Expand Up @@ -576,6 +577,15 @@ private void unscheduleSpec(URI specURI, String specVersion) throws JobException
this.scheduledFlowSpecs.remove(specURI.toString());
this.lastUpdatedTimeForFlowSpec.remove(specURI.toString());
unscheduleJob(specURI.toString());
try {
FlowSpec spec = (FlowSpec) this.flowCatalog.get().getSpecs(specURI);
Properties properties = spec.getConfigAsProperties();
_log.info("Scheduler trigger validation: [flowName: {} flowGroup: {}] - Unscheduled Spec",
properties.getProperty(ConfigurationKeys.JOB_NAME_KEY),
properties.getProperty(ConfigurationKeys.JOB_GROUP_KEY));
} catch (SpecNotFoundException e) {
_log.warn("Unable to retrieve spec for URI {}", specURI);
}
} else {
throw new JobException(String.format(
"Spec with URI: %s was not found in cache. May be it was cleaned, if not please clean it manually",
Expand Down