Skip to content

Commit 345b2aa

Browse files
authored
Merge 427a368 into 23d6437
2 parents 23d6437 + 427a368 commit 345b2aa

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

docs/docs/en/guide/task/dinky.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ it will call `Dinky API` to trigger dinky task. Click [here](http://www.dlink.to
1717

1818
- Please refer to [DolphinScheduler Task Parameters Appendix](appendix.md) `Default Task Parameters` section for default parameters.
1919

20-
| **Parameter** | **Description** |
21-
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
22-
| Dinky Address | The url for a dinky server. |
23-
| Dinky Task ID | The unique task id for a dinky task. |
24-
| Online Task | Specify whether the current dinky job is online. If yes, the submitted job can only be submitted successfully when it is published and there is no corresponding Flink job instance running. |
20+
| **Parameter** | **Description** |
21+
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
22+
| Dinky Address | The URL for the Dinky service, e.g., http://localhost:8888. |
23+
| Dinky Task ID | The unique task id for a dinky task. |
24+
| Online Task | Specify whether the current dinky job is online. If yes, the submitted job can only be submitted successfully when it is published and there is no corresponding Flink job instance running. |
25+
| Custom Parameters | Starting from Dinky 1.0, support for passing custom parameters is available. Currently, only `IN` type inputs are supported, with no support for `OUT` type outputs. Supports the `${param}` syntax for retrieving global or local dynamic parameters. |
2526

2627
## Task Example
2728

docs/docs/zh/guide/task/dinky.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717

1818
- 默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md)`默认任务参数`一栏。
1919

20-
| **任务参数** | **描述** |
21-
|-------------|---------------------------------------------------------------------|
22-
| Dinky 地址 | Dinky 服务的 url。 |
23-
| Dinky 任务 ID | Dinky 作业对应的唯一ID。 |
24-
| 上线作业 | 指定当前 Dinky 作业是否上线,如果是,则该被提交的作业只能处于已发布且当前无对应的 Flink Job 实例在运行才可提交成功。 |
20+
| **任务参数** | **描述** |
21+
|-------------|----------------------------------------------------------------------------|
22+
| Dinky 地址 | Dinky 服务的 url,例如:`http://localhost:8888`|
23+
| Dinky 任务 ID | Dinky 作业对应的唯一ID。 |
24+
| 上线作业 | 指定当前 Dinky 作业是否上线,如果是,则该被提交的作业只能处于已发布且当前无对应的 Flink Job 实例在运行才可提交成功。 |
25+
| 自定义参数 | 从Dinky 1.0开始支持传递自定义参数,目前仅支持`IN`类型输入,不支持`OUT`类型输出。支持`${param}`方式获取全局或局部动态参数 |
2526

2627
## Task Example
2728

141 KB
Loading

dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
2828
import org.apache.dolphinscheduler.plugin.task.api.model.Property;
2929
import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters;
30+
import org.apache.dolphinscheduler.plugin.task.api.parser.PlaceholderUtils;
31+
import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils;
3032

3133
import org.apache.commons.lang3.StringUtils;
3234
import org.apache.http.HttpResponse;
@@ -343,11 +345,15 @@ private Map<String, String> generateVariables() {
343345
}
344346
}
345347
List<Property> localParams = this.dinkyParameters.getLocalParams();
348+
Map<String, Property> prepareParamsMap = taskExecutionContext.getPrepareParamsMap();
346349
if (localParams == null || localParams.isEmpty()) {
347350
return variables;
348351
}
352+
Map<String, String> convertMap = ParameterUtils.convert(prepareParamsMap);
349353
for (Property property : localParams) {
350-
variables.put(property.getProp(), property.getValue());
354+
String propertyValue = property.getValue();
355+
String value = PlaceholderUtils.replacePlaceholders(propertyValue, convertMap, true);
356+
variables.put(property.getProp(), value);
351357
}
352358
return variables;
353359
}

0 commit comments

Comments
 (0)