Visual MapReduce model
The Visual MapReduce model extends the standard MapReduce model with visual and operational capabilities. Without modifying your backend code, you can change the execution mode to Visual MapReduce in the MSE SchedulerX console. This adds a subtask list page where you can view the details, results, and logs for each subtask, and rerun subtasks individually.
Limitations
-
Older SDK versions have security vulnerabilities. Upgrade your client to version 1.12.2 or later.
-
This feature is available only in the Professional Edition.
-
The number of subtasks cannot exceed 1,000.
-
A single subtask cannot exceed 64 KB in size.
-
To display custom labels for subtasks, the subtask object must implement the specified interface.
-
The
resultreturned byProcessResultcannot exceed 1,000 bytes. -
If you use the
reducemethod, the results of all subtasks are cached on the master node, causing high memory pressure. Keep the number of subtasks and the size of the returnedresultsmall. If you do not need thereducefunctionality, use theMapJobProcessorinterface. -
SchedulerX does not guarantee exactly-once execution for subtasks. In certain failover conditions, a subtask may be executed more than once. Your application must handle this by being idempotent.
Interfaces
-
This model inherits all interfaces from the MapReduce model. The development model for task processing code is identical to that of the MapReduce model. For more information, see MapReduce Model.
-
(Optional) In addition to the MapReduce model interfaces, you can set a display label for each subtask. The subtask object must implement the
com.alibaba.schedulerx.worker.processor.BizSubTaskinterface.Method
Description
Required
public Map<String, String> labelMap()Implement this method to return a map of custom labels for the subtask. These labels display business-specific identifiers for each subtask object in the console, such as an account name, product code, or city.
No
Comparison with MapReduce
|
Feature |
MapReduce |
Visual MapReduce |
|
Number of subtasks |
Supports millions of subtasks. |
Up to 1,000. |
|
Task development model |
Identical for both. |
|
|
Subtask list |
Not supported. |
Supported. |
|
Subtask execution details |
Not supported. |
Supported. You can view the execution record, status, logs, distributed tracing, and stack trace for each subtask. |
|
Subtask labels |
Not supported. |
Supported. If a subtask implements the |
|
Subtask operations |
Not supported. |
Supported. You can stop or rerun individual subtasks. |
Task development demo
Batch account processing
This example demonstrates how to process a batch of bank accounts. Each account is handled as an independent subtask and processed in parallel across the cluster. In the UI, each subtask displays its corresponding account information, making it easy to track the status and execution details for every account. The following code is a reference implementation.
-
Define a custom subtask object for account information. To display a label for each subtask, the object must implement the
com.alibaba.schedulerx.worker.processor.BizSubTaskinterface and itslabelMapmethod. -
Create a processor for the account-processing task. It should handle the business logic for a single account and extend
com.alibaba.schedulerx.worker.processor.MapReduceJobProcessor.
Procedure
Configure a task
-
Log on to the MSE SchedulerX console. In the left-side navigation pane, click Task Management.
-
On the Task Management page, click Add Task.
-
In the Add Task panel, select Visual MapReduce from the Execution Mode drop-down list.

-
In the Advanced Settings section, configure the parameters. For information about other parameters, see Advanced Settings parameter reference for Task Management.
Parameter
Description
Dispatch policy
Round-robin policy (Default): Distributes an equal number of subtasks to each worker node. This policy is suitable for scenarios where each subtask takes a similar amount of time to process.
WorkerLoad-based policy: The master node dynamically senses the load on each worker node and distributes subtasks accordingly. This policy is suitable for scenarios where processing times vary significantly across subtasks or worker nodes.
NoteRequires client version 1.10.14 or later.
Subtask concurrency per machine
The number of execution threads on a single machine. The default value is 5. To speed up execution, you can increase this value. If downstream systems or databases cannot handle the load, you can decrease it.
Subtask failure retry attempts
The number of times a failed subtask is automatically retried. The default value is 0.
Subtask failure retry interval
The interval between retry attempts for a failed subtask, in seconds. The default value is 0.
Subtask failover policy
Specifies whether to redistribute subtasks to other machines if an executing node goes down. If you enable this policy, subtasks may be executed more than once during a failover. You must implement idempotence in your application to handle this.
NoteRequires client version 1.8.13 or later.
Master node participation
Specifies whether the master node participates in subtask execution. This option requires at least two online worker nodes. We recommend disabling this option when the number of subtasks is very large.
NoteRequires client version 1.8.13 or later.
Visualization features
After a task runs, go to the Execution List page and click Details for an execution to view its subtask details.
-
On the Subtask list tab, you can view the processing status of each subtask.
-
On the Subtask list tab, click Log in the Actions column for a subtask to view its business logs and analyze its execution result.
-
While a task is running, go to the Current execution details tab and click View Stack to view the stack trace of the processing threads on the corresponding machine. This helps you diagnose issues such as hangs or performance bottlenecks.
-
On the Subtask list tab, if you have enabled distributed tracing, you can click a TraceId to view the complete call chain for that subtask. For more information, see Enable distributed tracing.
