This topic describes the detailed steps to perform various operations on scheduled jobs on the Task Management page.
Create a job
Before you create a job, ensure that you have created an application group. For more information, see application management.
-
Log on to the SchedulerX console.
-
In the top navigation bar, select a region.
-
In the left-side navigation pane, select task management.
-
On the page, select the namespace and click Create Task. On the Basic Configuration wizard page, configure the job parameters, and then click Next.
The following table describes the basic configuration parameters.
Parameter
Description
Name
A custom name for the job.
Description
A brief description to help you find and manage the job.
Application ID
The application group to which the job belongs. You can select an application group from the drop-down list.
Job Type
The programming language used to implement the job. Supported types include Java, XXL-JOB, SpringSchedule, Golang, script task, Http, and DataWorks. If you select script task, you must also select a script language (shell, python, or go) and write the job script in the editor.
Class full path
NoteThis parameter is available only when you set Job type to Java.
The full path of the JobProcessor, for example,
xxx.xxx.xxx.HelloProcessor.Execution Mode
The mode in which the job is executed. The following modes are supported:
-
Standalone: Executes the job on a randomly selected worker.
-
broadcast run: Executes the job on all available workers simultaneously and waits for them to complete.
-
Visual MapReduce: A Map model with a visual list of subtasks. You can run up to 300 subtasks.
The Professional Edition supports up to 1,000 subtasks and allows you to query subtasks by business keyword.
-
MapReduce: A standard MapReduce model that supports a large number of subtasks running in parallel. You can query only summary information for subtasks. This mode is recommended for 1,000,000 or fewer subtasks.
-
shard run: Similar to the elastic-job model. You configure sharding parameters to distribute shards evenly among multiple workers for execution. This mode supports multiple programming languages.
NoteThe parameters in advanced settings vary based on the selected Execution Mode.
Job Parameters
An arbitrary string that you can retrieve from the context at runtime.
The following table describes the advanced configuration parameters.
Parameter
Applicable execution mode
Description
Default
Job retry attempts on failure
General
The number of automatic retries if the job fails.
NoteA job fails if its worker restarts. Use this parameter to rerun the job immediately.
0
Job retry interval on failure
General
The interval between retries. Unit: seconds.
30
Job concurrency
General
The number of concurrent instances allowed for the job. A value of 1 indicates that instances of the job cannot run concurrently.
1
Cleanup policy
General
The cleanup policy for job execution history.
Keep the last N records
Number of records to keep
General
The number of historical execution records to retain.
300
Subtask concurrency per worker
-
Visual MapReduce
-
MapReduce
-
shard run
In a distributed model, this parameter specifies the number of subtasks that a single worker can process concurrently. You can increase this value to accelerate execution. If downstream services or databases cannot handle the load, you can decrease this value.
5
Subtask retry attempts on failure
-
Visual MapReduce
-
MapReduce
-
shard run
In a distributed model, this parameter specifies the number of times a subtask is automatically retried on failure.
0
Subtask retry interval on failure
-
Visual MapReduce
-
MapReduce
-
shard run
In a distributed model, this parameter specifies the interval between automatic retries for a failed subtask. Unit: seconds.
0
Subtask failover policy
-
Visual MapReduce
-
MapReduce
-
shard run
Specifies whether to redistribute subtasks to other workers if the executing worker goes offline. If you enable this feature, subtasks may be executed more than once during a failover. Ensure your code is idempotent.
NoteThis feature requires worker version 1.8.13 or later.
Master node participation in execution
-
Visual MapReduce
-
MapReduce
-
shard run
Specifies whether the master node also executes subtasks. At least two online workers are required. We recommend that you disable this parameter when the number of subtasks is very large.
NoteThis feature requires worker version 1.8.13 or later.
Subtask dispatching mode
-
Visual MapReduce
-
MapReduce
-
shard run
-
push model: Subtasks are evenly distributed to each worker.
-
pull model: Each worker pulls subtasks, which avoids the "slowest worker" effect. All subtasks are cached on the master node during this process, increasing memory pressure. This mode is recommended for 10,000 or fewer subtasks.
push model
Dispatching strategy
-
Visual MapReduce
-
MapReduce
The strategy for dispatching subtasks. By default, subtasks are dispatched to workers in a round-robin manner.
-
Round-robin strategy: Subtasks are distributed evenly to each worker. This strategy is suitable for scenarios where each subtask takes roughly the same amount of time to process.
-
Load-optimal strategy: The master node dynamically detects the load on each worker. This strategy is suitable for scenarios where processing times vary significantly across subtasks or workers.
NoteThis feature requires worker version 1.10.14 or later.
Dispatching rate
-
Visual MapReduce
-
MapReduce
The rate at which subtasks are dispatched. You can specify the number of subtasks dispatched per second or per minute.
Number of subtasks per pull (pull model only)
-
Visual MapReduce
-
MapReduce
-
shard run
The number of subtasks that a worker pulls from the master node in a single request.
5
Subtask queue capacity (pull model only)
-
Visual MapReduce
-
MapReduce
-
shard run
The size of the subtask cache queue on a worker.
10
Global subtask concurrency (pull model only)
-
Visual MapReduce
-
MapReduce
-
shard run
The pull model supports a global concurrency limit for subtasks, which can be used for rate limiting.
1,000
-
-
On the Schedule Configuration wizard page, set the timing parameters and advanced configuration parameters, and then click Next.
The following table describes the timing parameters.
Parameter
Description
Time Type
-
none: Not scheduled. The job is typically triggered by a workflow.
-
cron: The job is triggered based on a CRON expression.
-
api: The job is triggered by an API call.
-
fixed_rate: The job is triggered at a fixed frequency.
-
second_delay: The job is triggered after a fixed delay in seconds.
-
onetime: The job runs only once.
-
unix cron: The job is triggered based on a CRON expression in the standard UNIX format.
Cron Expression (available only if you set Time type to cron)
Enter a CRON expression. You can write the expression manually or use a tool to generate and validate it.
Fixed frequency (available only if you set Time type to fixed_rate)
Enter a fixed interval in seconds. The value must be 60 or greater. For example, a value of 200 means the job is scheduled every 200 seconds.
Fixed delay (available only if you set Time type to second_delay)
Enter a fixed delay in seconds. The value must be an integer from 1 to 60. For example, a value of 5 means the job is triggered after a 5-second delay.
Scheduling time (available only if you set Time type to onetime)
Enter the specific time to execute the job, for example,
2023-7-13 00:00:00.unix cron expression (available only if you set Time type to unix cron)
Enter a CRON expression in the standard UNIX format.
The following table describes the advanced configuration parameters.
Parameter
Description
Time offset
The offset of the data time relative to the scheduled time. You can retrieve this value from the context at runtime.
Time Zone
Select a time zone based on your requirements. You can choose from common countries and regions or use a standard GMT format.
-
-
On the Notification Configuration wizard page, set the alert parameters and contacts, and then click Finish.
Alert parameters include the Timeout Alert switch, Timeout (in seconds), Kill on Timeout switch, Success Notification switch, Failure Alert switch, Consecutive Failures, and the No Available Worker Alert switch. For Notification channel and contact, you can select Application group contact or Custom.
For Notification channel and contact, you can select Application group contact or Custom.
-
Application group contact
All contacts in the application group receive notifications.
-
Custom
You can specify a Contact Group or individual Contact to receive notifications.
-
Contact Group
All contacts in the selected contact group receive notifications. For more information about how to create a contact group, see Create a notification contact or a contact group.
-
Contact
1. Add the contacts who will receive notifications. You can add multiple notification contacts. After you click Add contact, click Go to create contact.
In the Notification channel and contact section, select Custom, select the webhook checkbox for Notification channel, and select Contact for Notification contact. If the contact drop-down list displays No options, no contacts are available.
2. On the page that appears, click Create Contact and enter the contact information.
Contact information includes Name (required), Phone number, Email, webhook, and Contact group.
-
-
-
Return to the task management page to verify that the job is created and correctly configured.
NoteBy default, jobs are enabled upon creation. You can disable and then re-enable them as needed. For more information, see Enable and disable a scheduled job.
Edit a job
-
On the Task Management page, find the job and click Edit in the Actions column.
-
In the Edit panel, configure the basic, scheduling, and alerting settings.
NoteYou cannot modify the Application ID and task type. The settings for other parameters are the same as when creating a job.
Run a job
On the Task Management page, click Run Once in the Actions column to run the job.
In the confirmation dialog box, select an instance for the specified machine, set the instance parameter, and click OK. The instance parameter does not override the job parameter.
Enable and disable jobs
Enable or disable a single job
-
On the Task Management page, in the Actions column for the desired job, click More and select Disable or Enable.
-
In the confirmation dialog box, click Confirm.
Enable or disable multiple jobs
The Professional Edition lets you enable or disable multiple jobs at once. On the Task Management page, select the desired jobs and click Batch disable or Batch enable below the job list.
Replicate job
On the Task Management page, choose More > Copy in the Actions column for the job. You can then edit the new job's configuration.
Rebrush a job
You can rebrush a job to backfill data for a past period. This is useful when your business requirements change, for example, if you add a new field to a database or if you need to correct data from the previous month.
This feature is available for both jobs and workflows that have a daily scheduling period.
If data from a previous job run has errors or is missing, you can rerun the job with specific parameters to reprocess the data for that period.
-
Log on to the SchedulerX console.
-
On the Task Management page, find the job, click More in the Actions column, and then click Rebrush task.
-
In the Rebrush task panel, set the Start and end date and Data time, and then click OK.
-
Start and end date: The date range for which you want to rerun the job.
-
Data time: The time of day used as the logical data time for each day in the specified range.
For example, consider the following configuration:
-
The current time is 10:00:00 on January 1, 2019.
-
The Start and end date is set from October 1, 2018 to October 7, 2018. This range covers the period from 00:00:00 on October 1, 2018 to 23:59:59 on October 7, 2018.
-
The Data time is set to 11:11:11.
In this scenario, the job reruns seven times, generating seven new instances.
S/N
Scheduling time
Data time
1
2019.1.1 10:00:00
2018.10.1 11:11:11
2
2019.1.1 10:00:00
2018.10.2 11:11:11
3
2019.1.1 10:00:00
2018.10.3 11:11:11
4
2019.1.1 10:00:00
2018.10.4 11:11:11
5
2019.1.1 10:00:00
2018.10.5 11:11:11
6
2019.1.1 10:00:00
2018.10.6 11:11:11
7
2019.1.1 10:00:00
2018.10.7 11:11:11
-
Execution and operation records
-
To view execution records, go to the Task Management page, find the job, and click More > Historical records in the Actions column.
-
To view operation records, go to the Task Management page, find the job, and click More > Operation Record in the Actions column. On the Operation Record page, you can filter records by Type and Task ID. The table lists the Task ID, Operation Time, Operation Type, Operator, and Extensions. To view the details of a record, click View in the Operation column.
Delete a job
-
To stop billing for SchedulerX, you must first delete or disable the jobs in your application to avoid charges.
-
If a job is part of a job orchestration, you must delete the associated workflow before you delete or disable the job.
For more information about the billable items and billing methods of SchedulerX, see Billing.
-
On the Task Management page, find the job that you want to delete, and then choose More > Delete in the Actions column.
-
In the confirmation dialog box, click Confirm.
Import or export tasks
-
On the Task Management page, select a Professional Edition application.
-
Click Import Jobs or Export Tasks.