Class EmbeddedQuartzScheduler
- java.lang.Object
-
- org.apache.flink.table.gateway.workflow.scheduler.EmbeddedQuartzScheduler
-
@Internal public class EmbeddedQuartzScheduler extends Object
An embedded workflow scheduler based on quartzScheduler
that store all workflow in memory, it does not have high availability. This scheduler will be embedded inSqlGateway
process to provide service by rest api.This embedded scheduler is mainly used for testing scenarios and is not suitable for production environment.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EmbeddedQuartzScheduler.EmbeddedSchedulerJob
TheJob
implementation for embedded quartz scheduler.
-
Constructor Summary
Constructors Constructor Description EmbeddedQuartzScheduler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.quartz.JobDetail
createScheduleWorkflow(WorkflowInfo workflowInfo, String cronExpression)
void
deleteScheduleWorkflow(String workflowName, String workflowGroup)
org.quartz.Scheduler
getQuartzScheduler()
void
resumeScheduleWorkflow(String workflowName, String workflowGroup, Map<String,String> dynamicOptions)
Resume a quartz schedule job with new dynamic options.void
start()
void
stop()
void
suspendScheduleWorkflow(String workflowName, String workflowGroup)
-
-
-
Method Detail
-
start
public void start()
-
stop
public void stop()
-
createScheduleWorkflow
public org.quartz.JobDetail createScheduleWorkflow(WorkflowInfo workflowInfo, String cronExpression) throws SchedulerException
- Throws:
SchedulerException
-
suspendScheduleWorkflow
public void suspendScheduleWorkflow(String workflowName, String workflowGroup) throws SchedulerException
- Throws:
SchedulerException
-
resumeScheduleWorkflow
public void resumeScheduleWorkflow(String workflowName, String workflowGroup, Map<String,String> dynamicOptions) throws SchedulerException
Resume a quartz schedule job with new dynamic options. If the dynamic options is empty, just resume the job. If the dynamic options is not empty, since we cannot update the old workflow job, we need to remove the old job and create a new job with new dynamic options. The new job will be with new dynamic options. The new job will use the same job key and cron expression as the old job.- Parameters:
workflowName
- The name of the workflow to be resumed.workflowGroup
- The group of the workflow to be resumed.dynamicOptions
- A map containing the new dynamic options for the workflow. If empty, the workflow is simply resumed.- Throws:
SchedulerException
- if the workflow does not exist or if there is an error resuming the workflow.
-
deleteScheduleWorkflow
public void deleteScheduleWorkflow(String workflowName, String workflowGroup) throws SchedulerException
- Throws:
SchedulerException
-
getQuartzScheduler
@VisibleForTesting public org.quartz.Scheduler getQuartzScheduler()
-
-