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 quartz Scheduler that store all workflow in memory, it does not have high availability. This scheduler will be embedded in SqlGateway process to provide service by rest api.

This embedded scheduler is mainly used for testing scenarios and is not suitable for production environment.

  • Constructor Details

    • EmbeddedQuartzScheduler

      public EmbeddedQuartzScheduler()
  • Method Details

    • 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()