diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/exceptions/WorkflowExecutionGraphInitializeFailureException.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/exceptions/WorkflowExecutionGraphInitializeFailureException.java deleted file mode 100644 index 98bfc2185b18..000000000000 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/exceptions/WorkflowExecutionGraphInitializeFailureException.java +++ /dev/null @@ -1,32 +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.engine.exceptions; - -import org.apache.dolphinscheduler.dao.entity.TaskInstance; - -public class WorkflowExecutionGraphInitializeFailureException extends RuntimeException { - - public WorkflowExecutionGraphInitializeFailureException(String message) { - super(message); - } - - public static WorkflowExecutionGraphInitializeFailureException bootstrapTaskStateNotValid(TaskInstance taskInstance) { - return new WorkflowExecutionGraphInitializeFailureException( - "The task: " + taskInstance.getName() + " state: " + taskInstance.getState() + " is not valid"); - } -} diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/system/SystemEventBusFireWorker.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/system/SystemEventBusFireWorker.java index 7a8cc6ef6712..7ebad89af652 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/system/SystemEventBusFireWorker.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/system/SystemEventBusFireWorker.java @@ -22,7 +22,6 @@ import org.apache.dolphinscheduler.common.thread.ThreadUtils; import org.apache.dolphinscheduler.server.master.engine.system.event.AbstractSystemEvent; import org.apache.dolphinscheduler.server.master.engine.system.event.ISystemEventHandler; -import org.apache.dolphinscheduler.server.master.failover.FailoverCoordinator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.time.StopWatch; @@ -43,9 +42,6 @@ public class SystemEventBusFireWorker extends BaseDaemonThread implements AutoCl @Autowired private SystemEventBus systemEventBus; - @Autowired - private FailoverCoordinator failoverCoordinator; - @Autowired private List systemEventHandlers; diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/execution/AbstractTaskInstanceFactory.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/execution/AbstractTaskInstanceFactory.java index 4a399bf3fbbc..0a2b38d6cbe6 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/execution/AbstractTaskInstanceFactory.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/execution/AbstractTaskInstanceFactory.java @@ -20,19 +20,13 @@ import org.apache.dolphinscheduler.dao.entity.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.WorkflowInstance; -import org.apache.dolphinscheduler.dao.mapper.EnvironmentMapper; import org.apache.dolphinscheduler.dao.utils.EnvironmentUtils; import org.apache.dolphinscheduler.dao.utils.WorkerGroupUtils; -import org.springframework.beans.factory.annotation.Autowired; - public abstract class AbstractTaskInstanceFactory implements ITaskInstanceFactory { - @Autowired - protected EnvironmentMapper environmentMapper; - protected TaskInstance cloneTaskInstance(TaskInstance originTaskInstance) { final TaskInstance result = new TaskInstance(); result.setId(originTaskInstance.getId()); diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/listener/ITaskExecutionLifecycleListener.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/listener/ITaskExecutionLifecycleListener.java deleted file mode 100644 index b5e67560c49e..000000000000 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/listener/ITaskExecutionLifecycleListener.java +++ /dev/null @@ -1,45 +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.engine.task.listener; - -import org.apache.dolphinscheduler.server.master.engine.task.lifecycle.event.TaskDispatchedLifecycleEvent; -import org.apache.dolphinscheduler.server.master.engine.task.lifecycle.event.TaskFailedLifecycleEvent; -import org.apache.dolphinscheduler.server.master.engine.task.lifecycle.event.TaskKilledLifecycleEvent; -import org.apache.dolphinscheduler.server.master.engine.task.lifecycle.event.TaskPausedLifecycleEvent; -import org.apache.dolphinscheduler.server.master.engine.task.lifecycle.event.TaskRunningLifecycleEvent; -import org.apache.dolphinscheduler.server.master.engine.task.lifecycle.event.TaskSuccessLifecycleEvent; - -/** - * Todo: this interface is used to listen to the lifecycle of the task execution runnable. - * We should use this to listen the state and trigger alert - */ -public interface ITaskExecutionLifecycleListener { - - void onDispatched(TaskDispatchedLifecycleEvent taskDispatchedEvent); - - void onRunning(TaskRunningLifecycleEvent event); - - void onPaused(TaskPausedLifecycleEvent event); - - void onFailed(TaskFailedLifecycleEvent event); - - void onKilled(TaskKilledLifecycleEvent event); - - void onSuccess(TaskSuccessLifecycleEvent event); - -} diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/statemachine/AbstractTaskStateAction.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/statemachine/AbstractTaskStateAction.java index c7c52ab24225..d053676e881b 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/statemachine/AbstractTaskStateAction.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/statemachine/AbstractTaskStateAction.java @@ -30,7 +30,6 @@ import org.apache.dolphinscheduler.plugin.task.api.utils.VarPoolUtils; import org.apache.dolphinscheduler.server.master.engine.AbstractLifecycleEvent; import org.apache.dolphinscheduler.server.master.engine.ITaskGroupCoordinator; -import org.apache.dolphinscheduler.server.master.engine.IWorkflowRepository; import org.apache.dolphinscheduler.server.master.engine.graph.IWorkflowExecutionGraph; import org.apache.dolphinscheduler.server.master.engine.task.client.ITaskExecutorClient; import org.apache.dolphinscheduler.server.master.engine.task.execution.ITaskExecution; @@ -66,9 +65,6 @@ public abstract class AbstractTaskStateAction implements ITaskStateAction { @Autowired protected TaskInstanceDao taskInstanceDao; - @Autowired - protected IWorkflowRepository workflowRepository; - @Autowired protected ITaskExecutorClient taskExecutorClient; diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/execution/WorkflowExecutionFactory.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/execution/WorkflowExecutionFactory.java index f9256fed9f68..1c495c6a139e 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/execution/WorkflowExecutionFactory.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/execution/WorkflowExecutionFactory.java @@ -20,7 +20,6 @@ import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.repository.CommandDao; -import org.apache.dolphinscheduler.dao.repository.WorkflowInstanceDao; import org.apache.dolphinscheduler.server.master.engine.command.ICommandHandler; import org.apache.dolphinscheduler.server.master.engine.exceptions.CommandDuplicateHandleException; @@ -39,9 +38,6 @@ public class WorkflowExecutionFactory { @Autowired private List commandHandlers; - @Autowired - private WorkflowInstanceDao workflowInstanceDao; - @Autowired private CommandDao commandDao; diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/lifecycle/handler/WorkflowFinalizeLifecycleEventHandler.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/lifecycle/handler/WorkflowFinalizeLifecycleEventHandler.java index 040d51768c64..381859acaa27 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/lifecycle/handler/WorkflowFinalizeLifecycleEventHandler.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/lifecycle/handler/WorkflowFinalizeLifecycleEventHandler.java @@ -18,8 +18,6 @@ package org.apache.dolphinscheduler.server.master.engine.workflow.lifecycle.handler; import org.apache.dolphinscheduler.server.master.engine.ILifecycleEventType; -import org.apache.dolphinscheduler.server.master.engine.IWorkflowRepository; -import org.apache.dolphinscheduler.server.master.engine.WorkflowEventBusCoordinator; import org.apache.dolphinscheduler.server.master.engine.workflow.execution.IWorkflowExecution; import org.apache.dolphinscheduler.server.master.engine.workflow.lifecycle.WorkflowLifecycleEventType; import org.apache.dolphinscheduler.server.master.engine.workflow.lifecycle.event.WorkflowFinalizeLifecycleEvent; @@ -27,8 +25,6 @@ import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; /** @@ -40,13 +36,6 @@ public class WorkflowFinalizeLifecycleEventHandler extends AbstractWorkflowLifecycleEventHandler { - @Lazy - @Autowired - private WorkflowEventBusCoordinator workflowEventBusCoordinator; - - @Autowired - private IWorkflowRepository workflowRepository; - @Override public void handle(final IWorkflowStateAction workflowStateAction, final IWorkflowExecution workflowExecution, diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/listener/WorkflowSuccessLifecycleListener.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/listener/WorkflowSuccessLifecycleListener.java index 7871593340a1..498561545389 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/listener/WorkflowSuccessLifecycleListener.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/listener/WorkflowSuccessLifecycleListener.java @@ -22,7 +22,6 @@ import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.entity.WorkflowInstance; -import org.apache.dolphinscheduler.dao.repository.CommandDao; import org.apache.dolphinscheduler.extract.master.command.BackfillWorkflowCommandParam; import org.apache.dolphinscheduler.extract.master.command.ICommandParam; import org.apache.dolphinscheduler.extract.master.transportor.workflow.WorkflowBackfillTriggerRequest; @@ -48,9 +47,6 @@ public class WorkflowSuccessLifecycleListener implements IWorkflowLifecycleListe @Autowired private WorkflowBackfillTrigger workflowBackfillTrigger; - @Autowired - private CommandDao commandDao; - @Override public void notifyWorkflowLifecycleEvent(final IWorkflowExecution workflowExecution, final AbstractWorkflowLifecycleLifecycleEvent lifecycleEvent) { diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/MasterTaskExecuteException.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/MasterTaskExecuteException.java index af1b0aa3db8e..3ff52ee3c694 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/MasterTaskExecuteException.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/MasterTaskExecuteException.java @@ -26,4 +26,5 @@ public MasterTaskExecuteException(String message) { public MasterTaskExecuteException(String message, Throwable cause) { super(message, cause); } + } diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/TaskExecuteRunnableCreateException.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/TaskExecuteRunnableCreateException.java deleted file mode 100644 index c90c508ec8a5..000000000000 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/TaskExecuteRunnableCreateException.java +++ /dev/null @@ -1,30 +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.exception; - -public class TaskExecuteRunnableCreateException extends MasterException { - - public TaskExecuteRunnableCreateException(String message) { - super(message); - } - - public TaskExecuteRunnableCreateException(String message, Throwable throwable) { - super(message, throwable); - } - -} diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/WorkflowCreateException.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/WorkflowCreateException.java deleted file mode 100644 index a2f94984ede2..000000000000 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/WorkflowCreateException.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.server.master.exception; - -public class WorkflowCreateException extends MasterException { - - public WorkflowCreateException(String message) { - super(message); - } - - public WorkflowCreateException(String message, Throwable throwable) { - super(message, throwable); - } -} 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); - } - -} diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/ExceptionUtils.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/ExceptionUtils.java index 5c1233f7dbf2..d9c977ffc9df 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/ExceptionUtils.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/ExceptionUtils.java @@ -18,8 +18,6 @@ package org.apache.dolphinscheduler.server.master.utils; import org.apache.dolphinscheduler.server.master.exception.TaskExecutionContextCreateException; -import org.apache.dolphinscheduler.server.master.exception.dispatch.NoAvailableWorkerException; -import org.apache.dolphinscheduler.server.master.exception.dispatch.WorkerGroupNotFoundException; import org.springframework.dao.DataAccessResourceFailureException; @@ -33,11 +31,4 @@ public static boolean isTaskExecutionContextCreateException(Throwable e) { return e instanceof TaskExecutionContextCreateException; } - public static boolean isWorkerGroupNotFoundException(Throwable e) { - return e instanceof WorkerGroupNotFoundException; - } - - public static boolean isNoAvailableWorkerException(Throwable e) { - return e instanceof NoAvailableWorkerException; - } } diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/WorkflowInstanceUtils.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/WorkflowInstanceUtils.java index 80954f21b381..dbf89bba401c 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/WorkflowInstanceUtils.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/WorkflowInstanceUtils.java @@ -21,7 +21,6 @@ import org.apache.dolphinscheduler.dao.entity.WorkflowInstance; import org.apache.dolphinscheduler.server.master.engine.WorkflowEventBus; import org.apache.dolphinscheduler.server.master.engine.graph.IWorkflowExecutionGraph; -import org.apache.dolphinscheduler.server.master.engine.graph.IWorkflowGraph; import org.apache.dolphinscheduler.server.master.engine.task.execution.ITaskExecution; import org.apache.dolphinscheduler.server.master.engine.workflow.execution.IWorkflowExecution; import org.apache.dolphinscheduler.server.master.runner.IWorkflowExecuteContext; @@ -39,7 +38,6 @@ public class WorkflowInstanceUtils { public static String logWorkflowInstanceInDetails(IWorkflowExecution workflowExecution) { final IWorkflowExecuteContext workflowExecuteContext = workflowExecution.getWorkflowExecuteContext(); final IWorkflowExecutionGraph workflowExecutionGraph = workflowExecuteContext.getWorkflowExecutionGraph(); - final IWorkflowGraph workflowGraph = workflowExecuteContext.getWorkflowGraph(); final WorkflowInstance workflowInstance = workflowExecuteContext.getWorkflowInstance(); final WorkflowEventBus workflowEventBus = workflowExecuteContext.getWorkflowEventBus();