DMS provides custom Airflow operators for secure access to DMS-managed resources. Choose the operators that suit your workflow.
Prerequisites
Procedure
For more information, see Workflow Development.
-
Navigate to the WORKSPACE or REPOS page to configure your code.
-
Configure the code in your Python file.
Operator
Description
Submits SQL to a DMS-managed database instance and retrieves the results.
Uses DTS to sync data from a DMS-managed database to OSS.
Runs a DMS-managed notebook file (.ipynb).
Submits Spark SQL to a specific resource group managed by AnalyticDB for MySQL (Lakehouse Edition) (task type: Interactive; engine: Spark).
Runs lock-free, large-scale DML operations through the DMS chunked DML service. Ideal for bulk UPDATE or DELETE operations on large tables.
Runs SQL or JAR tasks on the Lindorm Spark engine.
-
Run the Python file in the Airflow UI or using the REST API.
Common features
The following features apply to all DMS Airflow operators.
Task cancellation
All operators implement the on_kill() method. When Airflow sends a termination signal—for example, when a task is manually marked as failed or times out—the operator automatically calls the cancellation API of the corresponding cloud service to clean up remote tasks and prevent resource waste.
Retry mechanism
Task submission and status checks include built-in retries powered by tenacity:
-
Task submission: Up to 3 retries, with a 5-second interval.
-
Status check: Up to 5 retries, with a 3-second interval.