Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Job Dependency

Updated on 2022-08-17 GMT+08:00

You can set a job that meets the scheduling period conditions as the dependency jobs for a job that is scheduled periodically. For details about how to set a dependency job, see DataArts Factory > Job Development > Setting Up Scheduling for a Job in DataArts Studio User Guide.

For example, you can set a dependency job (job B) for job A which is scheduled periodically. In this case, job A will be executed only when all the instances of job B are executed successfully within a specified period.
NOTE:
  • The specified period is calculated as follows (see How a Job Runs After a Dependency Job Is Set for It for details):
    • Same-cycle dependency: If the scheduling periods of the two jobs are accurate to the same level (for example, minute, hour, or day), the specified period is (Execution time of job A – Recurrence of job A, Execution time of job A].
    • Cross-cycle dependency: If the scheduling periods of the two jobs are accurate to different levels, the specified period is [Natural start time of the previous recurrence of job A, Natural start time of the current recurrence of job A).
  • Parameter Policy for Current job If Dependency job Fails determines whether job A will check the status of job B's instances.
    • If this parameter is set to Suspend or Terminate, job A will be suspended or terminated if instances of job B fail during a specified time period.
    • If this parameter is set to Continue, job A will be executed only if all the instances of job B are executed (regardless of whether the execution is successful or not).
Figure 1 Job dependency attributes

This section describes how to set the conditions of a dependency job and how a job runs after a dependency job is set for it.

Setting Conditions of a Dependency Job

The recurrence of a periodically scheduled job can be minute, hour, day, week, or month. If job A and job B are both periodically scheduled jobs, and you want to set job B as the dependency job of job A, their recurrences must meet the following requirements:
  • The recurrence of job A cannot be shorter than that of job B. For example, if both job A and job B are scheduled by minute or hour and the interval of job A is shorter than that of job B, then job B cannot be set as the dependency job of job A. If job A is scheduled by minute and job B is scheduled by hour, job B cannot be set as the dependency job of job A.
  • The recurrence of neither job A nor job B can be week. For example, if the recurrence of job A or job B is week, job B cannot be set as the dependency job of job A.
  • A job whose recurrence is month can depend only on a job whose recurrence is day. For example, if the recurrence of job A is month, job B can be set as the dependency job of job A only if job B's recurrence is day.
Figure 2 shows the requirements of the recurrences of the jobs that can function as the dependency jobs of other jobs
Figure 2 Job dependency

How a Job Runs After a Dependency Job Is Set for It

It varies depending on whether a job and its dependency job has the same recurrence. In this example, assume that the Policy for Current job If Dependency job Fails parameter is set to Continue, and job A does not check the running statuses of job B's instances. If this parameter is set to Suspend or Terminate, job A will also check whether there are failed instances in job B.
  • Same-cycle dependency: Job A and its dependency job B have the same recurrence, for example, minute, hour, or day.

    After job B is set as the dependency job of job A, job A checks whether instances of job B are running within a specified time range (Execution time of job A – Recurrence of job A, Execution time of job A). Job A will be executed only if all the instances of job B are executed.

    Example 1: Job A depends on job B and they are both scheduled by minute. Job A starts at 10:00 and the interval is 20 minutes. Job B starts at 10:00 and the interval is 10 minutes. The following table lists how the two jobs run.
    Table 1 Example 1: dependency between jobs with the same recurrence

    Time Point

    Job B (Starting at 10:00 and Scheduled Every 10 Minutes)

    Job A (Starting at 10:00 and Scheduled Every 20 Minutes)

    10:00

    Executed

    Executed after job B's instances are executed in the (09:40, 10:00] time period

    10:10

    Executed

    -

    10:20

    Executed

    Executed after job B's instances are executed in the (10:00, 10:20] time period

    10:30

    Executed

    -

    ...

    ...

    ...

    Example 2: Job A depends on job B and they are both scheduled by day. Job A starts at 09:00 on August 1, and job B starts at 10:00 on August 1. The following table lists how the two jobs run.
    Table 2 Example 2: dependency between jobs with the same recurrence

    Time Point

    Job B (Starting at 10:00 on August 1 and Scheduled by Day)

    Job A (Starting at 09:00 on August 1 and Scheduled by Day)

    09:00 on August 1

    -

    Not executed if no instance of job B is running in the (09:00 on July 31, 09:00 on August 1] time period

    10:00 on August 1

    Executed

    -

    09:00 on August 2

    -

    Executed after job B's instances are executed in the (09:00 on August 1, 09:00 on August 2] time period

    10:00 on August 2

    Executed

    -

    ...

    ...

    ...

  • Cross-cycle dependency: Job A and its dependency job B have different recurrences.

    After job B is set as the dependent job of job A, job A checks whether any instance of job B is running in the time range (Natural start time of the previous recurrence of job A, Natural start time of the current recurrence of job A). Job A will be executed only after all the instances of job B are executed.

    NOTE:
    The natural start time of a recurrence is defined as follows:
    • If the recurrence is hour, the natural start time of the previous recurrence is 00:00 of the previous hour, and the natural start time of the current recurrence is 00:00 of the current hour.
    • If the recurrence is day, the natural start time of the previous recurrence is 00:00:00 of the previous day, and the natural start time of the current recurrence is 00:00:00 of the current day.
    • If the recurrence is month, the natural start time of the previous recurrence is 00:00:00 on 1st of the previous month, and the natural start time of the current recurrence is 00:00:00 on 1st of the current month.
    Example 3: Job A depends on job B. Job A is scheduled by day, and job B is scheduled by hour. Job A is executed at 02:00 every day. Job B starts at 00:00 and is executed at an interval of 10 hours. The following table lists how the two jobs run.
    Table 3 Example 3: dependency between jobs with different recurrences

    Time Point

    Job B (Starting at 00:00 at an Interval of 10 hours and Scheduled by Hour)

    Job A (Scheduled at 02:00 Every Day)

    00:00 on the first day

    Executed

    -

    02:00 on the first day

    -

    Not executed if no instance of job B is running in the [00:00:00 on day 0, 00:00:00 on day 1) time period

    10:00 on the first day

    Executed

    -

    20:00 on the first day

    Executed

    -

    00:00 on the second day

    Executed

    -

    02:00 on the second day

    -

    Executed if instances of job B are executed in the [00:00:00 on day 1, 00:00:00 on day 2) time period

    10:00 on the second day

    Executed

    -

    20:00 on the second day

    Executed

    -

    ...

    ...

    ...

    Example 4: Job A depends on job B. Job A is scheduled by month, and job B is scheduled by day. Job A is executed at 02:00 on the first and second days of each month. Job B is executed at 00:00 on August 1. The following table lists how the two jobs run.
    Table 4 Example 4: dependency between jobs with different recurrences

    Time Point

    Job B (Scheduled by Day and Executed at 00:00 on August 1)

    Job A (Scheduled by Month and Executed at 02:00 on the First and Second Days of Each Month)

    00:00 on August 1

    Executed

    -

    02:00 on August 1

    -

    Not executed if no instance of job B is running in the [00:00:00 on July 1, 00:00:00 on August 1) time period

    00:00 on August 2

    Executed

    -

    02:00 on August 2

    -

    Not executed if no instance of job B is running in the [00:00:00 on July 1, 00:00:00 on August 1) time period

    ...

    -

    ...

    00:00 on September 1

    Executed

    -

    02:00 on September 1

    -

    Executed if instances of job B are executed in the [00:00:00 on August 1, 00:00:00 on September 1) time period

    00:00 on September 2

    Executed

    -

    02:00 on September 2

    -

    Executed if instances of job B are executed in the [00:00:00 on August 1, 00:00:00 on September 1) time period

    ...

    ...

    ...

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback