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 quartzSchedulerthat store all workflow in memory, it does not have high availability. This scheduler will be embedded inSqlGatewayprocess 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 classEmbeddedQuartzScheduler.EmbeddedSchedulerJobTheJobimplementation 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.JobDetailcreateScheduleWorkflow(WorkflowInfo workflowInfo, String cronExpression)voiddeleteScheduleWorkflow(String workflowName, String workflowGroup)org.quartz.SchedulergetQuartzScheduler()voidresumeScheduleWorkflow(String workflowName, String workflowGroup, Map<String,String> dynamicOptions)Resume a quartz schedule job with new dynamic options.voidstart()voidstop()voidsuspendScheduleWorkflow(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()
-
-