Natural Periodic Scheduling: Dependency on the Previous Period
Introduction
The natural periods for job scheduling can be classified into the following types: minute, hour, day, week, or month. Figure 1 lists the scheduling periods that can be configured for the dependency jobs of jobs with different scheduling periods.
The scheduling of job A depends on the previous scheduling period of job B. The following scenarios are involved.
A Minute-Level Job Depends on Another Minute-Level Job
Rule: The minute is the minimum scheduling granularity, and there is no natural minute period. The dependency policy is to find the dependency instance of the job with a longer scheduling period in the previous scheduling period.
Example: Job A depends on job B. Job A is executed every 10 minutes, and job B is executed every 15 minutes, both starting from the 0th minute of each hour. Job A depends on the instance of job B which is generated at the 45th minute of the previous hour.
A Minute-Level Job Depends on an Hourly Job
Rule: A minute-level job is executed after the previous job which is executed each calendar hour is complete.
Example: Minute-level job A depends on hourly job B. Job A is triggered every 10 minutes, and job B is executed at the 18th minute of each hour. Job A depends on the instance of job B which is generated at the 18th minute of the previous hour.
A Minute-Level Job Depends on a Daily Job
Rule: A minute-level job depends on the previous period of the daily job and can be executed only after the previous daily job is executed.
Example: Job A depends on job B. Job A is executed every five minutes, and job B is executed at 02:30 every day. Job A depends on the instance of job B after 02:30 on the previous day.
An Hourly Job Depends on a Minute-Level Job
Rule: An hourly job depends on a minute-level job. The minute-level job instances within the last natural hour are executed (excluding the start time of the previous hour and including the start time of the current hour).
Example 1: Job A is an hourly job and is executed at the 0th minute of each hour. Job B is executed every 15 minutes. Job A depends on the instances of job B which are generated at the 45th minute of the previous hour.
An Hourly Job Depends on Another Hourly Job
Rule: Instances in each calendar hour depend on each other. The range boundary is [00:00, 00:59]. The dependency policy is to find dependency instances from the previous scheduling period of a job with a long scheduling period.
Job A depends on job B. In the same calendar hour, job A is always executed after job B is executed in the previous period.
Example: Job A is executed at the fifth minute of each hour and job B is executed at the 12th minute. Job A depends on the instance generated in the previous hour at the fifth minute of each hour.
An Hourly Job Depends on a Daily Job
Rule: An hourly job which depends on a daily job is executed only after the daily job is executed in the previous period.
Example: Job A depends on job B. If job A is executed at the top of each hour, and job B is executed at 02:30, job A depends on the instance of job B at 02:30 on the previous day.
A Daily Job Depends on a Minute-Level Job
Rule: Instances of a daily job depend on the instances of the minute-level jobs on the previous day.
Example: Job A is a daily job and depends on job B (minute-level). Job A depends on the last instance of job B on the previous day. Job A is executed after the last instance of job B is executed.
A Daily Job Depends on an Hourly Job
Rule: Instances of a daily job depend on the instances of an hourly job on the previous day.
Example: Job A is a daily job and depends on hourly job B. Job A depends on the instance of job B which is generated in the last period of the previous day.
A Daily Job Depends on Another Daily Job
Rule: A job depends on the instance of the previous period of a job which is scheduled every calendar day. If job A depends on job B within the same calendar day, job A always depends on the instance of job B in the previous period regardless of the execution time configured for job A and job B. The day range is [00:00:00,23:59:59].
Example: If job A is executed at 02:00 and job B is executed at 03:00, job A depends on the instance of job B executed at 03:00 in the previous period and is executed at 02:00 in the current period.
A Daily Job Depends on a Weekly Job
Rule: A daily job depends on a weekly job executed on the previous day. If the weekly job is not executed on the previous day, the daily job is directly executed. If the weekly job is executed on the previous day, the daily job will be executed after the weekly job is executed.
Example 1: Job A depends on job B. Job A is executed every day, and job B is executed every Wednesday. If the day before the day when job A is scheduled to be executed is not Wednesday, job B is not executed, and job A is directly executed.
Example 2: Job A depends on job B. Job A is executed every day, and job B is executed every Wednesday. If the day before the day when job A is scheduled to be executed is Wednesday, job B is executed, and job A is executed after job B is executed.
A Daily Job Depends on a Monthly Job
Rule: A daily job which depends on a monthly job is executed only after the monthly job is executed in the previous period .
Example: Job A depends on job B. Job A is executed once a day, and job B is executed once on the 15th day of each month. The execution of job A depends on the running instance of job B on the 15th day of the previous month.
A Weekly Job Depends on an Hourly Job
Rule: On a calendar day from 00:00 of the previous day (included) to 00:00 of the current day (excluded), weekly job A is executed after the tasks of hourly job B are executed.
Example: Job A depends on job B. Job A is scheduled every Monday, and job B is executed at the 50th minute of each hour. Job A is executed after the last task of job B is executed at 23:50 on last Sunday and an instance is generated.
A Weekly Job Depends on a Daily Job
Rule: A weekly job can be executed only after the daily job of the previous day is complete.
Example: Job A depends on job B. Job B is executed once everyday, and job A is executed once on every Monday. The execution of job A depends on the running instances of job B on the previous day.
A Weekly Job Depends on Another Weekly Job
Rule: A weekly job which depends on a weekly job of the previous day can be executed only after the weekly job of the previous day is complete. If there is no instance for the previous day, no dependency is required.
Example: Job A depends on job B. Job B is executed once on every Monday, and job A is executed once on every Tuesday. The execution of job A depends on the running instances of job B on every Monday.
A Weekly Job Depends on a Monthly Job
Rule: A weekly job depends on a monthly job executed on the previous day. If the monthly job is not executed on the previous day, the weekly job is directly executed. If the monthly job is executed on the previous day, the weekly job will be executed after the monthly job is executed.
Example 1: Job A depends on job B. Job A is executed every Wednesday, and job B is executed on the 10th day of each month. If the day before the day when job A is scheduled to be executed is the 10th day of a month, job A will be executed after job B is executed.
Example 2: Job A depends on job B. Job A is executed every Wednesday, and job B is executed on the 10th day of each month. If the previous day of the day when job A is scheduled to be executed is not the 10th day of a month, job A will be directly executed.
A Monthly Job Depends on a Daily Job
Rule: A monthly job can be executed only after the daily job of the previous day is complete.
Example: Job A depends on job B. Job B is executed once every day, and job A is executed once every month. The execution of job A depends on the running instances of job B on the previous day.
A Monthly Job Depends on a Weekly Job
Rule: A monthly job depends on a weekly job executed on the previous day. If the weekly job is not executed on the previous day, the monthly job is directly executed. If the weekly job is executed on the previous day, the monthly job will be executed after the weekly job is executed.
Example 1: Job A depends on job B. Job A is executed on the 10th day of each month, and job B is executed every Wednesday. If the day before the day when job A is scheduled to be executed is not Wednesday, job B is not executed, and job A is directly executed.
Example 2: Job A depends on job B. Job A is executed on the 10th day of each month, and job B is executed every Wednesday. If the day before the day when job A is scheduled to be executed is Wednesday, job B is executed, and job A is executed after job B is executed.
A Monthly Job Depends on Another Monthly Job
Rule: A monthly job depends on another monthly job executed on the previous day. If the depended monthly job is executed after the dependent job, the dependent job is executed properly. Except that, the dependency relationship works.
Example 1: Job A depends on job B. Job A is executed on the first day of each month, and job B is executed on the second day of each month. On the first day of a month, job A is executed normally without being blocked by job B.
Example 2: Job A depends on job B. Job A and job B are both executed on the second day of each month. Job A depends on the instance that is generated after job B is executed.
Example 3: Job A is executed on the third day of each month, and job B is executed on the second day of each month. Job A depends on job B.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot