This is an automated email from the ASF dual-hosted git repository.
zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new f5028d5384 [Improvement-18056] Remove unused code in worker module
(#18118)
f5028d5384 is described below
commit f5028d5384fa94007006f1f8e258da4bebff5d24
Author: xiangzihao <[email protected]>
AuthorDate: Thu Apr 2 09:22:03 2026 +0800
[Improvement-18056] Remove unused code in worker module (#18118)
---
.../resources/docker/ldap-login/application.yaml | 5 --
.../resources/docker/oidc-login/application.yaml | 3 --
.../src/main/resources/application.yaml | 2 -
.../config/TaskExecuteThreadsFullPolicy.java | 24 ----------
.../server/worker/metrics/TaskMetrics.java | 55 ----------------------
.../src/main/resources/application.yaml | 1 -
6 files changed, 90 deletions(-)
diff --git
a/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/ldap-login/application.yaml
b/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/ldap-login/application.yaml
index 4ba5960917..3bfbb304d7 100644
---
a/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/ldap-login/application.yaml
+++
b/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/ldap-login/application.yaml
@@ -184,8 +184,6 @@ master:
worker:
# worker listener port
listen-port: 1234
- # worker execute thread number to limit task instances in parallel
- exec-threads: 10
# worker heartbeat interval
max-heartbeat-interval: 10s
# worker host weight to dispatch tasks, default value 100
@@ -202,12 +200,9 @@ worker:
max-system-memory-usage-percentage-thresholds: 0.9
# Worker max disk usage , when the worker's disk usage is smaller then
this value, worker server can be dispatched tasks.
max-disk-usage-percentage-thresholds: 0.9
- task-execute-threads-full-policy: REJECT
tenant-config:
# tenant corresponds to the user of the system, which is used by the
worker to submit the job. If system does not have this user, it will be
automatically created after the parameter worker.tenant.auto.create is true.
auto-create-tenant-enabled: true
- # Scenes to be used for distributed users. For example, users created by
FreeIpa are stored in LDAP. This parameter only applies to Linux, When this
parameter is true, worker.tenant.auto.create has no effect and will not
automatically create tenants.
- distributed-tenant: false
# If set true, will use worker bootstrap user as the tenant to execute
task when the tenant is `default`;
default-tenant-enabled: true
diff --git
a/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/oidc-login/application.yaml
b/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/oidc-login/application.yaml
index cb37190244..9d6f47fd81 100644
---
a/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/oidc-login/application.yaml
+++
b/dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/oidc-login/application.yaml
@@ -138,7 +138,6 @@ master:
worker:
listen-port: 1234
- exec-threads: 10
max-heartbeat-interval: 10s
host-weight: 100
group: default
@@ -148,10 +147,8 @@ worker:
max-jvm-cpu-usage-percentage-thresholds: 0.9
max-system-memory-usage-percentage-thresholds: 0.9
max-disk-usage-percentage-thresholds: 0.9
- task-execute-threads-full-policy: REJECT
tenant-config:
auto-create-tenant-enabled: true
- distributed-tenant: false
default-tenant-enabled: true
alert:
diff --git
a/dolphinscheduler-standalone-server/src/main/resources/application.yaml
b/dolphinscheduler-standalone-server/src/main/resources/application.yaml
index a25283b225..0c8d5d2024 100644
--- a/dolphinscheduler-standalone-server/src/main/resources/application.yaml
+++ b/dolphinscheduler-standalone-server/src/main/resources/application.yaml
@@ -243,8 +243,6 @@ worker:
tenant-config:
# tenant corresponds to the user of the system, which is used by the
worker to submit the job. If system does not have this user, it will be
automatically created after the parameter worker.tenant.auto.create is true.
auto-create-tenant-enabled: true
- # Scenes to be used for distributed users. For example, users created by
FreeIpa are stored in LDAP. This parameter only applies to Linux, When this
parameter is true, worker.tenant.auto.create has no effect and will not
automatically create tenants.
- distributed-tenant: false
# If set true, will use worker bootstrap user as the tenant to execute
task when the tenant is `default`;
default-tenant-enabled: true
diff --git
a/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/config/TaskExecuteThreadsFullPolicy.java
b/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/config/TaskExecuteThreadsFullPolicy.java
deleted file mode 100644
index 437acc3e7f..0000000000
---
a/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/config/TaskExecuteThreadsFullPolicy.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.dolphinscheduler.server.worker.config;
-
-public enum TaskExecuteThreadsFullPolicy {
- CONTINUE,
- REJECT,
- ;
-}
diff --git
a/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/metrics/TaskMetrics.java
b/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/metrics/TaskMetrics.java
deleted file mode 100644
index 32213774b4..0000000000
---
a/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/metrics/TaskMetrics.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.dolphinscheduler.server.worker.metrics;
-
-import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ServiceLoader;
-
-import lombok.experimental.UtilityClass;
-import io.micrometer.core.instrument.Counter;
-import io.micrometer.core.instrument.Metrics;
-
-@UtilityClass
-public class TaskMetrics {
-
- private final Map<String, Counter> taskTypeExecutionCounter = new
HashMap<>();
- private final Counter taskUnknownTypeExecutionCounter =
- Counter.builder("ds.task.execution.count.by.type")
- .tag("task_type", "unknown")
- .description("task execution counter by type")
- .register(Metrics.globalRegistry);
-
- static {
- for (TaskChannelFactory taskChannelFactory :
ServiceLoader.load(TaskChannelFactory.class)) {
- taskTypeExecutionCounter.put(
- taskChannelFactory.getName(),
- Counter.builder("ds.task.execution.count.by.type")
- .tag("task_type", taskChannelFactory.getName())
- .description("task execution counter by type")
- .register(Metrics.globalRegistry));
- }
- }
-
- public void incrTaskTypeExecuteCount(String taskType) {
- taskTypeExecutionCounter.getOrDefault(taskType,
taskUnknownTypeExecutionCounter).increment();
- }
-
-}
diff --git a/dolphinscheduler-worker/src/main/resources/application.yaml
b/dolphinscheduler-worker/src/main/resources/application.yaml
index ef1793fb7e..c3580ac56f 100644
--- a/dolphinscheduler-worker/src/main/resources/application.yaml
+++ b/dolphinscheduler-worker/src/main/resources/application.yaml
@@ -59,7 +59,6 @@ worker:
max-system-memory-usage-percentage-thresholds: 0.8
# Worker max disk usage , when the worker's disk usage is smaller then
this value, worker server can be dispatched tasks.
max-disk-usage-percentage-thresholds: 0.8
- task-execute-threads-full-policy: REJECT
physical-task-config:
# The number of threads in the Physical task engine that used to execute
tasks
task-executor-thread-size: 100