From 6888bcf1a5eec6c534b4c6a5e7ae52404dcf0957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E4=B9=89=E8=B6=85?= Date: Fri, 10 Apr 2026 17:03:21 +0800 Subject: [PATCH 1/2] Clean up unused methods and classes --- .../extract/base/IRpcResponse.java | 2 - .../extract/base/StandardRpcResponse.java | 6 - .../exception/RemoteTimeoutException.java | 8 - .../extract/base/future/InvokeCallback.java | 29 ---- .../extract/base/future/ReleaseSemaphore.java | 39 ----- .../base/utils/CallerThreadExecutePolicy.java | 36 ----- .../extract/base/utils/ChannelUtils.java | 10 -- .../extract/base/utils/Constants.java | 51 ------- .../common/transportor/GetAppIdRequest.java | 35 ----- .../common/transportor/GetAppIdResponse.java | 33 ----- .../master/IWorkflowMetricService.java | 29 ---- .../master/command/AbstractCommandParam.java | 2 - .../extract/master/command/ICommandParam.java | 5 - .../master/dto/TaskInstanceExecuteDto.java | 112 -------------- .../master/dto/WorkflowExecuteDto.java | 137 ------------------ .../transportor/ITaskExecutionEvent.java | 55 ------- .../master/rpc/WorkflowMetricServiceImpl.java | 37 ----- 17 files changed, 626 deletions(-) delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/InvokeCallback.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/ReleaseSemaphore.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/CallerThreadExecutePolicy.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/Constants.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdRequest.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdResponse.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/IWorkflowMetricService.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/TaskInstanceExecuteDto.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/WorkflowExecuteDto.java delete mode 100644 dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/transportor/ITaskExecutionEvent.java delete mode 100644 dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/rpc/WorkflowMetricServiceImpl.java diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java index 498efb104724..ac3551c86c25 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java @@ -25,6 +25,4 @@ public interface IRpcResponse { byte[] getBody(); - byte[] toBytes(); - } diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java index 21a6afa76ecb..8c7e1f540b84 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java @@ -17,8 +17,6 @@ package org.apache.dolphinscheduler.extract.base; -import org.apache.dolphinscheduler.extract.base.serialize.JsonSerializer; - import lombok.Data; @Data @@ -47,8 +45,4 @@ public static StandardRpcResponse fail(String message) { return rpcResponse; } - @Override - public byte[] toBytes() { - return JsonSerializer.serialize(this); - } } diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java index abbd374250cb..d7f31a9da269 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java @@ -22,14 +22,6 @@ */ public class RemoteTimeoutException extends RemoteException { - public RemoteTimeoutException(String message) { - super(message); - } - - public RemoteTimeoutException(String address, long timeoutMillis) { - this(address, timeoutMillis, null); - } - public RemoteTimeoutException(String address, long timeoutMillis, Throwable cause) { super(String.format("wait response on the channel %s timeout %s", address, timeoutMillis), cause); } diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/InvokeCallback.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/InvokeCallback.java deleted file mode 100644 index bf12fbe119da..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/InvokeCallback.java +++ /dev/null @@ -1,29 +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.extract.base.future; - -public interface InvokeCallback { - - /** - * operation - * - * @param responseFuture responseFuture - */ - void operationComplete(final ResponseFuture responseFuture); - -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/ReleaseSemaphore.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/ReleaseSemaphore.java deleted file mode 100644 index 2230a56456c5..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/future/ReleaseSemaphore.java +++ /dev/null @@ -1,39 +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.extract.base.future; - -import java.util.concurrent.Semaphore; -import java.util.concurrent.atomic.AtomicBoolean; - -public class ReleaseSemaphore { - - private final Semaphore semaphore; - - private final AtomicBoolean released; - - public ReleaseSemaphore(Semaphore semaphore) { - this.semaphore = semaphore; - this.released = new AtomicBoolean(false); - } - - public void release() { - if (this.released.compareAndSet(false, true)) { - this.semaphore.release(); - } - } -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/CallerThreadExecutePolicy.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/CallerThreadExecutePolicy.java deleted file mode 100644 index bc14b7cb4fc5..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/CallerThreadExecutePolicy.java +++ /dev/null @@ -1,36 +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.extract.base.utils; - -import java.util.concurrent.RejectedExecutionHandler; -import java.util.concurrent.ThreadPoolExecutor; - -import lombok.extern.slf4j.Slf4j; - -/** - * caller thread execute - */ -@Slf4j -public class CallerThreadExecutePolicy implements RejectedExecutionHandler { - - @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { - log.warn("queue is full, trigger caller thread execute"); - r.run(); - } -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/ChannelUtils.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/ChannelUtils.java index f5261ef8aba1..333dbfdc2818 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/ChannelUtils.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/ChannelUtils.java @@ -31,16 +31,6 @@ private ChannelUtils() { throw new IllegalStateException(ChannelUtils.class.getName()); } - /** - * get local address - * - * @param channel channel - * @return local address - */ - public static String getLocalAddress(Channel channel) { - return NetUtils.getHost(((InetSocketAddress) channel.localAddress()).getAddress()); - } - /** * get remote address * diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/Constants.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/Constants.java deleted file mode 100644 index 8d0a66333cd7..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/utils/Constants.java +++ /dev/null @@ -1,51 +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.extract.base.utils; - -import org.apache.dolphinscheduler.common.utils.NetUtils; - -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; - -/** - * constant - */ -public class Constants { - - private Constants() { - throw new IllegalStateException(Constants.class.getName()); - } - - public static final String COMMA = ","; - - public static final String SLASH = "/"; - - /** - * charset - */ - public static final Charset UTF8 = StandardCharsets.UTF_8; - - public static final int CPUS = Runtime.getRuntime().availableProcessors(); - - public static final String LOCAL_ADDRESS = NetUtils.getHost(); - - public static final String OS_NAME = System.getProperty("os.name"); - - public static final int WARM_UP_TIME = 10 * 60 * 1000; - -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdRequest.java b/dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdRequest.java deleted file mode 100644 index d6f0077b63d2..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdRequest.java +++ /dev/null @@ -1,35 +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.extract.common.transportor; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class GetAppIdRequest { - - private int taskInstanceId; - - private String logPath; - -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdResponse.java b/dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdResponse.java deleted file mode 100644 index db3fc2af8999..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-common/src/main/java/org/apache/dolphinscheduler/extract/common/transportor/GetAppIdResponse.java +++ /dev/null @@ -1,33 +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.extract.common.transportor; - -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class GetAppIdResponse { - - private List appIds; - -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/IWorkflowMetricService.java b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/IWorkflowMetricService.java deleted file mode 100644 index cfb4204890c7..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/IWorkflowMetricService.java +++ /dev/null @@ -1,29 +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.extract.master; - -import org.apache.dolphinscheduler.extract.base.RpcMethod; -import org.apache.dolphinscheduler.extract.base.RpcService; - -@RpcService -public interface IWorkflowMetricService { - - @RpcMethod - void clearWorkflowMetrics(Long workflowDefinitionCode); - -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/AbstractCommandParam.java b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/AbstractCommandParam.java index 42ee634f5707..7af669da9609 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/AbstractCommandParam.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/AbstractCommandParam.java @@ -30,8 +30,6 @@ @NoArgsConstructor public abstract class AbstractCommandParam implements ICommandParam { - protected boolean subWorkflowInstance; - protected List startNodes; protected List commandParams; diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/ICommandParam.java b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/ICommandParam.java index 17ac808e4530..ad4c04169b31 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/ICommandParam.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/command/ICommandParam.java @@ -52,11 +52,6 @@ public interface ICommandParam { */ String getTimeZone(); - /** - * Whether the command is used to trigger a sub workflow instance. - */ - boolean isSubWorkflowInstance(); - /** * Get the command type. */ diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/TaskInstanceExecuteDto.java b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/TaskInstanceExecuteDto.java deleted file mode 100644 index fa24a151ebff..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/TaskInstanceExecuteDto.java +++ /dev/null @@ -1,112 +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.extract.master.dto; - -import org.apache.dolphinscheduler.common.enums.Flag; -import org.apache.dolphinscheduler.common.enums.Priority; -import org.apache.dolphinscheduler.common.enums.TaskExecuteType; -import org.apache.dolphinscheduler.plugin.task.api.enums.TaskExecutionStatus; - -import java.util.Date; -import java.util.Map; - -import lombok.Data; - -@Data -public class TaskInstanceExecuteDto { - - private int id; - - private String name; - - private String taskType; - - private int processInstanceId; - - private long taskCode; - - private int taskDefinitionVersion; - - private String processInstanceName; - - private int taskGroupPriority; - - private TaskExecutionStatus state; - - private Date firstSubmitTime; - - private Date submitTime; - - private Date startTime; - - private Date endTime; - - private String host; - - private String executePath; - - private String logPath; - - private int retryTimes; - - private Flag alertFlag; - - private int pid; - - private String appLink; - - private Flag flag; - - private String duration; - - private int maxRetryTimes; - - private int retryInterval; - - private Priority taskInstancePriority; - - private Priority processInstancePriority; - - private String workerGroup; - - private Long environmentCode; - - private String environmentConfig; - - private int executorId; - - private String varPool; - - private String executorName; - - private Map resources; - - private int delayTime; - - private String taskParams; - - private int dryRun; - - private int taskGroupId; - - private Integer cpuQuota; - - private Integer memoryMax; - - private TaskExecuteType taskExecuteType; -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/WorkflowExecuteDto.java b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/WorkflowExecuteDto.java deleted file mode 100644 index b4c7978dc813..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/dto/WorkflowExecuteDto.java +++ /dev/null @@ -1,137 +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.extract.master.dto; - -import org.apache.dolphinscheduler.common.enums.CommandType; -import org.apache.dolphinscheduler.common.enums.FailureStrategy; -import org.apache.dolphinscheduler.common.enums.Flag; -import org.apache.dolphinscheduler.common.enums.Priority; -import org.apache.dolphinscheduler.common.enums.TaskDependType; -import org.apache.dolphinscheduler.common.enums.WarningType; -import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus; - -import java.util.Collection; -import java.util.Date; - -import lombok.Data; - -@Data -public class WorkflowExecuteDto { - - private int id; - - private String name; - - private Long processDefinitionCode; - - private int processDefinitionVersion; - - private WorkflowExecutionStatus state; - - /** - * recovery flag for failover - */ - private Flag recovery; - - private Date startTime; - - private Date endTime; - - private int runTimes; - - private String host; - - private CommandType commandType; - - private String commandParam; - - /** - * node depend type - */ - private TaskDependType taskDependType; - - private int maxTryTimes; - - /** - * failure strategy when task failed. - */ - private FailureStrategy failureStrategy; - - private WarningType warningType; - - private Integer warningGroupId; - - private Date scheduleTime; - - private Date commandStartTime; - - /** - * user define parameters string - */ - private String globalParams; - - private int executorId; - - private String executorName; - - private String tenantCode; - - private String queue; - - /** - * process is sub process - */ - private Flag isSubProcess; - - /** - * history command - */ - private String historyCmd; - - /** - * depend processes schedule time - */ - private String dependenceScheduleTimes; - - private String duration; - - private Priority processInstancePriority; - - private String workerGroup; - - private Long environmentCode; - - private int timeout; - - private int tenantId; - - /** - * varPool string - */ - private String varPool; - - private int nextProcessInstanceId; - - private int dryRun; - - private Date restartTime; - - private boolean isBlocked; - - private Collection taskInstances; -} diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/transportor/ITaskExecutionEvent.java b/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/transportor/ITaskExecutionEvent.java deleted file mode 100644 index 8d9f4f7a9026..000000000000 --- a/dolphinscheduler-extract/dolphinscheduler-extract-master/src/main/java/org/apache/dolphinscheduler/extract/master/transportor/ITaskExecutionEvent.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.extract.master.transportor; - -// todo: add event source to distinguish the event is from executor or user operation -// 将这个类移到common中? -public interface ITaskExecutionEvent { - - int getWorkflowInstanceId(); - - int getTaskInstanceId(); - - long getEventCreateTime(); - - void setEventCreateTime(long eventCreateTime); - - Long getEventSendTime(); - - void setEventSendTime(Long eventSendTime); - - void setWorkflowInstanceHost(String host); - - String getWorkflowInstanceHost(); - - void setTaskInstanceHost(String host); - - String getTaskInstanceHost(); - - TaskInstanceExecutionEventType getEventType(); - - enum TaskInstanceExecutionEventType { - DISPATCHED, - RUNNING, - PAUSED, - KILLED, - FAILED, - SUCCESS, - } - -} diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/rpc/WorkflowMetricServiceImpl.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/rpc/WorkflowMetricServiceImpl.java deleted file mode 100644 index f5b0ce804717..000000000000 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/rpc/WorkflowMetricServiceImpl.java +++ /dev/null @@ -1,37 +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.master.rpc; - -import org.apache.dolphinscheduler.extract.master.IWorkflowMetricService; -import org.apache.dolphinscheduler.server.master.metrics.WorkflowInstanceMetrics; - -import lombok.extern.slf4j.Slf4j; - -import org.springframework.stereotype.Service; - -@Slf4j -@Service -public class WorkflowMetricServiceImpl implements IWorkflowMetricService { - - @Override - public void clearWorkflowMetrics(Long workflowDefinitionCode) { - log.info("Receive clearWorkflowMetrics request: {}", workflowDefinitionCode); - WorkflowInstanceMetrics.cleanUpWorkflowInstanceCountMetricsByDefinitionCode(workflowDefinitionCode); - } - -} From 4a7af802cba270432aedc949e9781bf60db924c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E4=B9=89=E8=B6=85?= Date: Tue, 28 Apr 2026 15:41:18 +0800 Subject: [PATCH 2/2] Revert some changes --- .../dolphinscheduler/extract/base/IRpcResponse.java | 2 ++ .../extract/base/StandardRpcResponse.java | 6 ++++++ .../extract/base/exception/RemoteTimeoutException.java | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java index ac3551c86c25..498efb104724 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/IRpcResponse.java @@ -25,4 +25,6 @@ public interface IRpcResponse { byte[] getBody(); + byte[] toBytes(); + } diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java index 8c7e1f540b84..21a6afa76ecb 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/StandardRpcResponse.java @@ -17,6 +17,8 @@ package org.apache.dolphinscheduler.extract.base; +import org.apache.dolphinscheduler.extract.base.serialize.JsonSerializer; + import lombok.Data; @Data @@ -45,4 +47,8 @@ public static StandardRpcResponse fail(String message) { return rpcResponse; } + @Override + public byte[] toBytes() { + return JsonSerializer.serialize(this); + } } diff --git a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java index d7f31a9da269..abbd374250cb 100644 --- a/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java +++ b/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/exception/RemoteTimeoutException.java @@ -22,6 +22,14 @@ */ public class RemoteTimeoutException extends RemoteException { + public RemoteTimeoutException(String message) { + super(message); + } + + public RemoteTimeoutException(String address, long timeoutMillis) { + this(address, timeoutMillis, null); + } + public RemoteTimeoutException(String address, long timeoutMillis, Throwable cause) { super(String.format("wait response on the channel %s timeout %s", address, timeoutMillis), cause); }