Configuring Hourly Scheduling
This section describes how to develop a batch processing pipeline job that runs at hourly intervals, configure parameters for the MRS Hive SQL node, and run the job. When you run the job, the system generates job instances based on the configured hourly scheduling parameters. You can view the run log of the job to locate faults.
When configuring the job, you can select either interval hours or discrete hours.
The following table describes the differences between the two scenarios.
| Scheduling Scenario | Difference |
|---|---|
| Interval hours | When the effective time, start time, interval, and end time are set for a job, the job is scheduled at the specified interval. For example, if the effective time of a job is set to May 20, 2025, and the scheduling plan remains valid, the job is scheduled once every two hours from 00:00 to 23:59. The job runs at 00:00:00, 02:00:00, 04:00:00, and until 22:00:00 on May 20, 2025, at an interval of two hours. On the next day, that is, May 21, 2025, the job starts running at 00:00:00 and runs every two hours. |
| Discrete hours | When the effective time, discrete hours, and a specific minute are set for a job, the job is scheduled at the discrete hours. For example, if the effective time of a job is set to May 20, 2025, the scheduling plan remains valid, the discrete hours are set to 09:00, 10:00, 15:00, 16:00, and 19:00 every day, and the minute is set to 00. The job runs at 09:00:00, 10:00:00, 15:00:00, 16:00:00, and 19:00:00 on May 20, 2025. On the next day, that is, May 21, 2025, the job also runs at 09:00:00, 10:00:00, 15:00:00, 16:00:00, and 19:00:00. |
Basic Concepts
- Job (in DataArts Factory): A job is composed of one or more nodes that run together to complete data operations.
- Node: A node defines the actions to be performed on data. For example, the MRS Hive SQL node can execute the Hive SQL scripts predefined in DataArts Factory. DML and DDL SQL statements can be transferred to the MRS Hive SQL node for execution.
- Periodic scheduling: Jobs are automatically executed at a specified interval. An appropriate scheduling period is required. A maximum of five instances can be concurrently executed in a job. If the start time of a job instance is later than the configured job execution time, the job instances in the subsequent batch will be queued. As a result, the job execution costs a longer time than expected.
- Job dependency: You can select jobs that are executed periodically in different workspaces as dependency jobs. The current job starts only after its dependency jobs are executed.
Operation Process
| Operation | Procedure | Description |
|---|---|---|
| Creating a batch processing pipeline job | Select Batch processing for Job Type and Pipeline for Mode. Retain the default values for other parameters. | |
| Configuring node parameters | See Step 5. | After the job is created, you can drag and drop one or more nodes on the canvas. The nodes are executed in sequence like a pipeline. You need to configure parameters for the job nodes so that they can be scheduled. |
| Configuring job parameters (such as parameters for hourly scheduling and job dependencies) | Configure hourly scheduling parameters. After the job scheduling starts, the job will run based on the configured hourly scheduling parameters. The current job starts running only after the jobs it depends on are complete. | |
| Scheduling the job | After the job scheduling starts, go to the job monitoring page to view the job execution result. If the job fails, you can view the run log to locate the fault. |
Preparations
- Create a proxy data connection named hive_000001 in Management Center. For details, see MRS Hive Connection Parameters.
- Create a database named default. For details, see Creating a Database.
- Create a Hive SQL script named hive_0520. For details, see Developing an SQL Script.
Procedure
- In the left navigation pane of DataArts Factory, choose .
- Right-click the directory and select Create Job.
- Select Batch processing for Job Type and enter job_8750 for Job Name.
- Set other basic job parameters and click OK to access the job development page.
- Drag the MRS Hive SQL node to the canvas, click the node name, and set node parameters. For details about the parameters of the MRS Hive SQL node, see MRS Hive SQL.
The key parameters are as follows:
- SQL script: Select the hive_0520 script you have created.
- Script Parameter: Set parameters as needed. If the SQL script does not use any parameters, Script Parameter is not displayed.
- Data Connection: Select the hive_000001 data connection you have created (the data connection selected in the script). Figure 1 Setting node parameters
Set other parameters as needed. Advanced parameters are set by default. You can choose not to modify them.
- Click Scheduling Setup on the right, set Scheduling Type to Run periodically, and set Scheduling Frequency to Hours.
- Interval Hour
Set Start Time to 00:00, Interval to 2 Hours, and End Time to 23:59.
Figure 2 Scheduling by interval hours
- Discrete Hour
Set the job scheduling time, for example, 09:00, 10:00, 15:00, 16:00, and 19:00 every day.
Figure 3 Scheduling by discrete hours
You can specify the time points for running the job every day. In the discrete hour scheduling mode, you can specify the minute.
- Interval Hour
- Configure the job dependencies. The current job starts after its dependencies are complete. For details about the dependency policies for periodic scheduling, see Dependency Policies for Periodic Scheduling. Figure 4 Configuring job dependencies
- After configuring the scheduling and dependency parameters, retain the default values for other job parameters.
- After configuring the job, save and submit the version. Figure 5 Submitting a job version
- Click Execute to start the job.
- The current job starts after its dependencies are complete. Before that, the current job is in waiting state.
- An appropriate scheduling period is required. A maximum of five instances can be concurrently executed in a job. If the start time of a job instance is later than the configured job execution time, the job instances in the subsequent batch will be queued. As a result, the job execution costs a longer time than expected. In addition, if the scheduling period of the dependency differs significantly from that of the current job, the job may not run properly. Ensure that the scheduling periods meet service rules.
- In the discrete-hour scheduling mode, there are a wide range of dependency choices, for example, dependency on the latest job. For details, see Scheduling by Discrete Hours and Scheduling by the Nearest Job Instance.
- In the navigation pane on the left, choose Monitoring > Job Monitoring. On the Batch Jobs page, view the job execution result. Figure 6 Batch Jobs
Reference
- Creating data connections: You can create data connections by configuring data sources. Based on the data connections in Management Center, DataArts Studio connects to the data lake foundation and provides data development, governance, services, and operations. When the data connection of a script or job is released in the development environment, the connection is automatically switched to the data connection of the production environment. For details, see Creating a DataArts Studio Data Connection.
- Creating tables: You can create tables on the DataArts Factory console, or using DDL or a SQL script. You are advised to create tables on the DataArts Factory console with no code. For details, see Creating a Table.
- Configuring job node parameters: A node defines the actions to be performed on data. DataArts Factory provides nodes used for data integration, compute and analysis, database operations, and resource management. You can choose your desired nodes. For details, see Node Parameter Configuration.
- Dependency policies for periodic scheduling: Currently, DataArts Factory supports two types of dependency policies, that is, dependency between jobs whose scheduling periods are traditional periods and dependency between jobs whose scheduling periods are natural periods. For details, see Dependency Policies for Periodic Scheduling.
- Scheduling by discrete hours and scheduling by the nearest job instance: Many new rules are available for natural periodic scheduling, such as scheduling by discrete hours and scheduling by the nearest job instance. For details, see Scheduling by Discrete Hours and Scheduling by the Nearest Job Instance.
What is your overall rating for this page?
Thank 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