Skip to content

Commit c478ba4

Browse files
authored
Merge branch 'dev' into doc
2 parents 1a4b0bf + dcf69ca commit c478ba4

File tree

46 files changed

+306
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+306
-234
lines changed

docs/docs/en/guide/task/flink.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Flink task type, used to execute Flink programs. For Flink nodes:
3737
| Parallelism | Used to set the degree of parallelism for executing Flink tasks. |
3838
| Yarn queue | Used to set the yarn queue, use `default` queue by default. |
3939
| Main program parameters | Set the input parameters for the Flink program and support the substitution of custom parameter variables. |
40-
| Optional parameters | Support `--jar`, `--files`,` --archives`, `--conf` format. |
40+
| Optional parameters | Set the flink command options, such as `-D`, `-C`, `-yt`. |
4141
| Custom parameter | It is a local user-defined parameter for Flink, and will replace the content with `${variable}` in the script. |
4242

4343
## Task Example

docs/docs/en/guide/task/spark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Spark task type for executing Spark application. When executing the Spark task,
3535
| Executor memory size | Set the size of Executor memories, which can be set according to the actual production environment. |
3636
| Yarn queue | Set the yarn queue, use `default` queue by default. |
3737
| Main program parameters | Set the input parameters of the Spark program and support the substitution of custom parameter variables. |
38-
| Optional parameters | Support `--jars`, `--files`,` --archives`, `--conf` format. |
38+
| Optional parameters | Set the spark command options, such as `--jars`, `--files`,` --archives`, `--conf`. |
3939
| Resource | Appoint resource files in the `Resource` if parameters refer to them. |
4040
| Custom parameter | It is a local user-defined parameter for Spark, and will replace the content with `${variable}` in the script. |
4141
| Predecessor task | Selecting a predecessor task for the current task, will set the selected predecessor task as upstream of the current task. |

docs/docs/zh/guide/task/flink.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Flink 任务类型,用于执行 Flink 程序。对于 Flink 节点:
3737
| 并行度 | 用于设置执行 Flink 任务的并行度 |
3838
| Yarn 队列 | 用于设置 Yarn 队列,默认使用 default 队列 |
3939
| 主程序参数 | 设置 Flink 程序的输入参数,支持自定义参数变量的替换 |
40-
| 选项参数 | 支持 `--jar``--files``--archives``--conf` 格式 |
40+
| 选项参数 | 设置Flink命令的选项参数,例如`-D`, `-C`, `-yt` |
4141
| 自定义参数 | 是 Flink 局部的用户自定义参数,会替换脚本中以 ${变量} 的内容 |
4242

4343
## 任务样例

docs/docs/zh/guide/task/spark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Spark 任务类型用于执行 Spark 应用。对于 Spark 节点,worker 支
3434
- Executor 内存数:用于设置 Executor 内存数,可根据实际生产环境设置对应的内存数。
3535
- Yarn 队列:用于设置 Yarn 队列,默认使用 default 队列。
3636
- 主程序参数:设置 Spark 程序的输入参数,支持自定义参数变量的替换。
37-
- 选项参数:支持 `--jars``--files``--archives``--conf` 格式
37+
- 选项参数:设置Spark命令的选项参数,例如`--jars``--files``--archives``--conf`
3838
- 资源:如果其他参数中引用了资源文件,需要在资源中选择指定。
3939
- 自定义参数:是 Spark 局部的用户自定义参数,会替换脚本中以 ${变量} 的内容。
4040

dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717

1818
package org.apache.dolphinscheduler.alert;
1919

20+
import org.apache.dolphinscheduler.alert.metrics.AlertServerMetrics;
2021
import org.apache.dolphinscheduler.alert.plugin.AlertPluginManager;
2122
import org.apache.dolphinscheduler.alert.registry.AlertRegistryClient;
2223
import org.apache.dolphinscheduler.alert.rpc.AlertRpcServer;
2324
import org.apache.dolphinscheduler.alert.service.AlertBootstrapService;
2425
import org.apache.dolphinscheduler.alert.service.ListenerEventPostService;
2526
import org.apache.dolphinscheduler.common.constants.Constants;
2627
import org.apache.dolphinscheduler.common.lifecycle.ServerLifeCycleManager;
28+
import org.apache.dolphinscheduler.common.thread.DefaultUncaughtExceptionHandler;
2729
import org.apache.dolphinscheduler.common.thread.ThreadUtils;
2830

2931
import javax.annotation.PreDestroy;
@@ -54,6 +56,8 @@ public class AlertServer {
5456
private AlertRegistryClient alertRegistryClient;
5557

5658
public static void main(String[] args) {
59+
AlertServerMetrics.registerUncachedException(DefaultUncaughtExceptionHandler::getUncaughtExceptionCount);
60+
Thread.setDefaultUncaughtExceptionHandler(DefaultUncaughtExceptionHandler.getInstance());
5761
Thread.currentThread().setName(Constants.THREAD_NAME_ALERT_SERVER);
5862
new SpringApplicationBuilder(AlertServer.class).run(args);
5963
}

dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/metrics/AlertServerMetrics.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ public void registerPendingAlertGauge(final Supplier<Number> supplier) {
4545
.register(Metrics.globalRegistry);
4646
}
4747

48+
public static void registerUncachedException(final Supplier<Number> supplier) {
49+
Gauge.builder("ds.alert.uncached.exception", supplier)
50+
.description("number of uncached exception")
51+
.register(Metrics.globalRegistry);
52+
}
53+
4854
public void incAlertSuccessCount() {
4955
alertSuccessCounter.increment();
5056
}

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
package org.apache.dolphinscheduler.api;
1919

20+
import org.apache.dolphinscheduler.api.metrics.ApiServerMetrics;
2021
import org.apache.dolphinscheduler.common.enums.PluginType;
22+
import org.apache.dolphinscheduler.common.thread.DefaultUncaughtExceptionHandler;
2123
import org.apache.dolphinscheduler.dao.PluginDao;
2224
import org.apache.dolphinscheduler.dao.entity.PluginDefine;
2325
import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory;
@@ -51,6 +53,8 @@ public class ApiApplicationServer {
5153
private PluginDao pluginDao;
5254

5355
public static void main(String[] args) {
56+
ApiServerMetrics.registerUncachedException(DefaultUncaughtExceptionHandler::getUncaughtExceptionCount);
57+
Thread.setDefaultUncaughtExceptionHandler(DefaultUncaughtExceptionHandler.getInstance());
5458
SpringApplication.run(ApiApplicationServer.class);
5559
}
5660

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
import org.apache.dolphinscheduler.api.exceptions.ApiException;
2828
import org.apache.dolphinscheduler.api.service.DataAnalysisService;
2929
import org.apache.dolphinscheduler.api.utils.Result;
30-
import org.apache.dolphinscheduler.api.vo.TaskInstanceCountVo;
31-
import org.apache.dolphinscheduler.api.vo.WorkflowDefinitionCountVo;
32-
import org.apache.dolphinscheduler.api.vo.WorkflowInstanceCountVo;
30+
import org.apache.dolphinscheduler.api.vo.TaskInstanceCountVO;
31+
import org.apache.dolphinscheduler.api.vo.WorkflowDefinitionCountVO;
32+
import org.apache.dolphinscheduler.api.vo.WorkflowInstanceCountVO;
3333
import org.apache.dolphinscheduler.common.constants.Constants;
3434
import org.apache.dolphinscheduler.dao.entity.User;
3535

@@ -71,7 +71,7 @@ public class DataAnalysisController extends BaseController {
7171
@GetMapping(value = "/task-state-count")
7272
@ResponseStatus(HttpStatus.OK)
7373
@ApiException(TASK_INSTANCE_STATE_COUNT_ERROR)
74-
public Result<TaskInstanceCountVo> getTaskInstanceStateCount(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
74+
public Result<TaskInstanceCountVO> getTaskInstanceStateCount(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
7575
@RequestParam(value = "startDate", required = false) String startDate,
7676
@RequestParam(value = "endDate", required = false) String endDate,
7777
@RequestParam(value = "projectCode", required = false) Long projectCode) {
@@ -91,7 +91,7 @@ public Result<TaskInstanceCountVo> getTaskInstanceStateCount(@Parameter(hidden =
9191
@GetMapping(value = "/process-state-count")
9292
@ResponseStatus(HttpStatus.OK)
9393
@ApiException(COUNT_PROCESS_INSTANCE_STATE_ERROR)
94-
public Result<WorkflowInstanceCountVo> getWorkflowInstanceStateCount(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
94+
public Result<WorkflowInstanceCountVO> getWorkflowInstanceStateCount(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
9595
@RequestParam(value = "startDate", required = false) String startDate,
9696
@RequestParam(value = "endDate", required = false) String endDate,
9797
@RequestParam(value = "projectCode", required = false) Long projectCode) {
@@ -109,7 +109,7 @@ public Result<WorkflowInstanceCountVo> getWorkflowInstanceStateCount(@Parameter(
109109
@GetMapping(value = "/define-user-count")
110110
@ResponseStatus(HttpStatus.OK)
111111
@ApiException(COUNT_PROCESS_DEFINITION_USER_ERROR)
112-
public Result<WorkflowDefinitionCountVo> countDefinitionByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
112+
public Result<WorkflowDefinitionCountVO> countDefinitionByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
113113
@RequestParam(value = "projectCode", required = false) Long projectCode) {
114114
if (projectCode == null) {
115115
return Result.success(dataAnalysisService.getAllWorkflowDefinitionCount(loginUser));

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/metrics/ApiServerMetrics.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
package org.apache.dolphinscheduler.api.metrics;
1919

2020
import java.util.concurrent.TimeUnit;
21+
import java.util.function.Supplier;
2122

2223
import lombok.experimental.UtilityClass;
2324
import io.micrometer.core.instrument.Counter;
2425
import io.micrometer.core.instrument.DistributionSummary;
26+
import io.micrometer.core.instrument.Gauge;
2527
import io.micrometer.core.instrument.Metrics;
2628
import io.micrometer.core.instrument.Timer;
2729

@@ -120,4 +122,10 @@ public void cleanUpApiResponseTimeMetricsByUserId(final int userId) {
120122
"ds.api.response.time",
121123
"user.id", String.valueOf(userId)));
122124
}
125+
126+
public static void registerUncachedException(final Supplier<Number> supplier) {
127+
Gauge.builder("ds.api.uncached.exception", supplier)
128+
.description("number of uncached exception")
129+
.register(Metrics.globalRegistry);
130+
}
123131
}

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import org.apache.dolphinscheduler.api.dto.DefineUserDto;
2222
import org.apache.dolphinscheduler.api.dto.TaskCountDto;
2323
import org.apache.dolphinscheduler.api.dto.project.StatisticsStateRequest;
24-
import org.apache.dolphinscheduler.api.vo.TaskInstanceCountVo;
25-
import org.apache.dolphinscheduler.api.vo.WorkflowDefinitionCountVo;
26-
import org.apache.dolphinscheduler.api.vo.WorkflowInstanceCountVo;
24+
import org.apache.dolphinscheduler.api.vo.TaskInstanceCountVO;
25+
import org.apache.dolphinscheduler.api.vo.WorkflowDefinitionCountVO;
26+
import org.apache.dolphinscheduler.api.vo.WorkflowInstanceCountVO;
2727
import org.apache.dolphinscheduler.dao.entity.User;
2828

2929
import java.util.List;
@@ -34,27 +34,27 @@
3434
*/
3535
public interface DataAnalysisService {
3636

37-
TaskInstanceCountVo getTaskInstanceStateCountByProject(User loginUser,
37+
TaskInstanceCountVO getTaskInstanceStateCountByProject(User loginUser,
3838
Long projectCode,
3939
String startDate,
4040
String endDate);
4141

42-
TaskInstanceCountVo getAllTaskInstanceStateCount(User loginUser,
42+
TaskInstanceCountVO getAllTaskInstanceStateCount(User loginUser,
4343
String startDate,
4444
String endDate);
4545

46-
WorkflowInstanceCountVo getWorkflowInstanceStateCountByProject(User loginUser,
46+
WorkflowInstanceCountVO getWorkflowInstanceStateCountByProject(User loginUser,
4747
Long projectCodes,
4848
String startDate,
4949
String endDate);
5050

51-
WorkflowInstanceCountVo getAllWorkflowInstanceStateCount(User loginUser,
51+
WorkflowInstanceCountVO getAllWorkflowInstanceStateCount(User loginUser,
5252
String startDate,
5353
String endDate);
5454

55-
WorkflowDefinitionCountVo getWorkflowDefinitionCountByProject(User loginUser, Long projectCode);
55+
WorkflowDefinitionCountVO getWorkflowDefinitionCountByProject(User loginUser, Long projectCode);
5656

57-
WorkflowDefinitionCountVo getAllWorkflowDefinitionCount(User loginUser);
57+
WorkflowDefinitionCountVO getAllWorkflowDefinitionCount(User loginUser);
5858

5959
/**
6060
* statistics the workflow quantities of certain user

0 commit comments

Comments
 (0)